Ruby On Rails Interview Questions and Answers
Ques 66. HOW CAN YOU UPLOAD A FILE TO A SERVER in Ruby on Rails?
Paperclip is the best solution to manage file uploads to a server.
It can also help you with multiple file uploads and associate it with ActiveRecord.
There are also good examples online that show how you can make rotating sliders with the paperclip images.
Another nice solution is using carrier_wave gem.
The nice thing about carrier_wave is that it has good documentation on how to integrate with S3, Google & Rackspace for file storage.
You can achieve the same file storage capability with Paperclip as well though.
Ques 67. HOW CAN YOU GENERATE SITEMAPS FOR YOUR RAILS SITE?Ans. You can use dynamic_sitemaps gem to generate sitemaps.
Ques 68. HOW CAN YOU SHOW SEARCH USER FRIENDLY URLS INSTEAD OF USING ONLY NUMERIC IDS in Ruby on Rails?Ans.
The simplest way to do this is to use the gem FriendlyID.
It gives you the ability to specify a friendly URL for pages so that instead of the standard page URLs like:
You can build pages such as:
Ques 69. HOW CAN YOU CREATE PAGE TITLES AND METADATA FOR YOUR PAGES in Ruby on Rails?Ans.
You can use the Headliner plugin for adding page titles.
You can use the MetaMagic plugin to add meta tags.
Ques 70. HOW CAN YOU CREATE BREADCRUMBS ON YOUR PAGES in Ruby on Rails?Ans.
Gretel is a great plugin to introduce breadcrumbs in your Rails application.
Another very simple implementation is breadcrumb_on_rails.
Most helpful rated by users: