![]() | Changes in Chapter 7. Handling Mobile Views |
|
14 Apr 2012, 10:18
Romeo Giezendanner (7 posts) |
Work through this chapter, I found follow small changes to the code: artflow/responsive/app/controllers/comments_controller.rb def index @project = @creation.project @comments = @creation.comments end artflow/responsive/app/controllers/creations_controller.rb def show @creation = Creation.find(params[:id]) @project = @creation.project ... end add following actions: def edit
@creation = Creation.find(params[:id])
@project = @creation.project
end
def update
@creation = Creation.find(params[:id])
if @creation.update_attributes(params[:creation])
redirect_to @creation
else
render action: 'edit'
end
end
artflow/responsive/app/views/comments/index.mobile.erb <%= render 'layouts/header' %> artflow/responsive/app/views/creations/_creation.mobile.erb <%= link_to(image_tag(creation.url(:square_thumb), alt: creation.name)) %> artflow/responsive/app/views/creations/show.mobile.erb <%= render 'layouts/header' %> artflow/responsive/app/views/creations/_form.html.erb |
| You must be logged in to comment |

