Advertisement
saasbook

create_method_with_flash.rb

Aug 15th, 2013
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.17 KB | None | 0 0
  1. # in movies_controller.rb
  2. def create
  3.   @movie = Movie.create!(params[:movie])
  4.   flash[:notice] = "#{@movie.title} was successfully created."
  5.   redirect_to movies_path
  6. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement