Ruby%20On%20Rails%20Interview%20Questions%20and%20Answers
Question: What is Flash in Ruby on Rails?Answer:Flash is simply a way to pass some value to the next action. Anything you place in the flash will be exposed to the very next action and then cleared out. Here’s an example: def destroy Then wherever you want to use the flash you can write this code. I often put this snippet in the application.html.erb file, somewhere towards the top: <% if !flash[:notice].blank? %> |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is Ruby On Rails?
- Why Ruby on Rails?
- Explain how (almost) everything is an object in Ruby.
- What are Gems and which are some of your favorites?
- How would you declare and use a constructor in Ruby?