Skip to content

Commit

Permalink
minor changes to make consistent with ruby intro chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
armandofox committed Dec 18, 2011
1 parent f965824 commit d2eebe5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 2 additions & 4 deletions app/assets/stylesheets/application.css
Expand Up @@ -19,12 +19,10 @@ h1, h2 {
background-color: #ddd;
margin: 0;
}
form {
padding: 1em;
border-style: inset;
}
form label {
display: block;
color: #333;
font-style: italic;
padding-top: 1ex;
padding-left: 1ex;
}
7 changes: 7 additions & 0 deletions app/controllers/movies_controller.rb
Expand Up @@ -31,4 +31,11 @@ def update
redirect_to movie_path(@movie)
end

def destroy
@movie = Movie.find(params[:id])
@movie.destroy
flash[:notice] = "Movie '#{@movie.title}' deleted."
redirect_to movies_path
end

end
2 changes: 2 additions & 0 deletions app/views/layouts/application.html.haml
Expand Up @@ -3,6 +3,8 @@
%head
%title Rotten Potatoes!
= stylesheet_link_tag 'application'
= javascript_include_tag 'application'
= csrf_meta_tags

%body
- if flash[:notice]
Expand Down
2 changes: 1 addition & 1 deletion app/views/movies/index.html.haml
Expand Up @@ -14,6 +14,6 @@
%td= movie.title
%td= movie.rating
%td= movie.release_date
%td= link_to "More about #{movie.title}", movie
%td= link_to "More about #{movie.title}", movie_path(movie)

= link_to 'Add new movie', new_movie_path
1 change: 1 addition & 0 deletions app/views/movies/show.html.haml
Expand Up @@ -15,4 +15,5 @@
%p#description= @movie.description

= link_to 'Edit', edit_movie_path(@movie)
= button_to 'Delete', movie_path(@movie), :method => :delete, :confirm => 'Are you sure?'
= link_to 'Back to movie list', movies_path

0 comments on commit d2eebe5

Please sign in to comment.