14 Apr 2012, 10:18
Romeo_pragsmall

Romeo Giezendanner (7 posts)

Work through this chapter, I found follow small changes to the code:

artflow/responsive/app/controllers/comments_controller.rb
add line: ’@project = @creation.project’ in index action:

def index
  @project = @creation.project
  @comments = @creation.comments
end

artflow/responsive/app/controllers/creations_controller.rb
add line: ’@project = @creation.project’ in show action:

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
change the header tag to render a partial:

<%= render 'layouts/header' %>

artflow/responsive/app/views/creations/_creation.mobile.erb
the follow line missing the last parenthesis:

<%= link_to(image_tag(creation.url(:square_thumb), alt: creation.name)) %>

artflow/responsive/app/views/creations/show.mobile.erb
change the header tag to render a partial:

<%= render 'layouts/header' %>

artflow/responsive/app/views/creations/_form.html.erb
change f.buttons to f.actions

  You must be logged in to comment