【发布时间】:2014-05-09 21:25:12
【问题描述】:
每当我启动我的 rails 服务器并运行 resume builder 时,我都会收到以下错误:
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,期待关键字_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
请帮忙!
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3