RAILS ERROR:ResumesController中的SyntaxError #new

时间:2014-05-09 21:25:13

标签: ruby-on-rails ruby ruby-on-rails-3

每当我启动rails服务器并运行简历构建器时,我都会收到以下错误:

root / app / controllers / resumes_controller.rb:38:语法错误,意外的keyword_end

root / app / controllers / resumes_controller.rb:121:语法错误,意外的keyword_end

root / app / controllers / resumes_controller.rb:131:语法错误,意外$ end,期待keyword_end

继续我的resumes_controller.rb文件行25 - 40

     # GET /resume/1
     # GET /resume/1.json
     def show
@resume = current_user.resumes.find(params[:id])
layout = current_user.resumes.find(params[:id]).layout || "application"
respond_to do |format|
  format.html # show.html.erb
  format.json { render json: @resume }
  format.pdf do
    render :pdf => "file_name",
    :layout   => "resumes/#{layout}.pdf.erb",
    :temwkhtmltopdfplate => "resumes/pdf_layouts/show.html.erb",
    :wkhtmltopdf  => Rails.root.join('bin', 'wkhtmltopdf-amd64').to_s,
  end
end
end

和继承人我的第111 - 124行

     def short_link
@resume = Resume.where(short_link: params[:short_link]).first
layout = @resume.layout || "application"
respond_to do |format|
  format.html {  render layout: @resume.layout }# show.html.erb
  format.pdf do
    render :pdf => "file_name",
    :layout   => "resumes/#{layout}.pdf.erb",
    :template => "resumes/pdf_layouts/show.html.erb",
    :wkhtmltopdf  => Rails.root.join('bin', 'wkhtmltopdf-amd64').to_s,
  end
end
end 

最后是第126-131行

      private
  def correct_user
    user = User.find(params[:user_id])
    redirect_to root_path unless current_user?(user)
  end
  end

请帮助!

1 个答案:

答案 0 :(得分:0)

首先两个:删除逗号:

:wkhtmltopdf  => Rails.root.join('bin', 'wkhtmltopdf-amd64').to_s,

最后一个:需要更多上下文 - 你在某个地方有未封闭的块。