Responsive pages with Artisteer / Ruby
I use Artisteer to generate the templates for my Joomla, WordPress and Rails sites. I put together a Ruby on Rails site and it was not responsive. I dusted off some memory cells and remembered that there was a line in the layouts/application.html.erb file that needed to be changed. A file comparison with the same file from an app that was responsive pointed me in the right direction.
There was a line
that I brought over from the default ruby application.html.erb file.
That needed to be changed to
//= require script
//= require script.responsive
and the following to config/initializers/assets.rb
Rails.application. config.assets.precompile = [‘*.js’, ‘*.css’, ‘*.css.erb’] #for Production
Rails.application.config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif] #for Production
Rails.application.config.assets.precompile += %w(script.js)
Rails.application.config.assets.precompile += %w(script.responsive.js)
Rails.application.config.assets.precompile += %w( style.css )
Rails.application.config.assets.precompile += %w( style.responsive.css )
Rails.application.config.assets.precompile += %w( style.ie7.css )
Oh, and don’t forget to restart your rails server after all of that is done. If everything goes well, you should now have a responsive site. You can do a quick check by simply resizing the aspect ratio on your browser window. At some point, you should see the block with the three horizontal bars instead of the full menu
- Artisteer templates with Ruby on Rails – Header and graphics not showing – solution
- Adding icons for editing, deleting and saving records in Ruby on Rails
- Running Rails Console in production while using Spring
- Validating CSV imports in Rails
- You must enable html multi for file uploads.
- Viewing your SQLLite Data (Ruby on Rails beginners)
- Showing the file name before committing to an upload of a CSV file in Ruby on Rails
- Rails – Pop up window with no header, footer or navigation