Skip to content

Commit

Permalink
modified application.html.haml and MoviesController#create to be cons…
Browse files Browse the repository at this point in the history
…istent with Ruby intro chapter text
  • Loading branch information
armandofox committed Dec 18, 2011
1 parent cef91ac commit ffad8f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions app/controllers/movies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def new
end

def create
@movie = Movie.new(params[:movie])
@movie.save!
@movie = Movie.create!(params[:movie])
flash[:notice] = "#{@movie.title} was successfully created."
redirect_to movies_path
end
Expand Down
13 changes: 6 additions & 7 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
= stylesheet_link_tag 'general'

%body
%h1= link_to 'Rotten Potatoes!', movies_path
#body
- if flash[:notice]
#flash_notice= flash[:notice]
- elsif flash[:error]
#flash_error= flash[:error]
= yield
- if flash[:notice]
#notice.message= flash[:notice]
- elsif flash[:warning]
#warning.message= flash[:warning]

= yield

0 comments on commit ffad8f7

Please sign in to comment.