E
E
eldar_web2015-12-07 20:24:16
Ruby on Rails
eldar_web, 2015-12-07 20:24:16

How to create a new flash in Ruby on Rails???

In the controller I create flash.now[:success]
And in the view I write if success ... , an error is displayed.
How to decide?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
eldar_web, 2015-12-07
@eldar_web

<% if flah[:succes] %>
   <%= flash[:succes] %>
<% end %>

V
Vladimir Miroshnichenko, 2015-12-07
@gururuby

In the view, use flash[:success] and not success
api.rubyonrails.org/classes/ActionDispatch/Flash.html
And if you get an error, then show it here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question