我想通过单击链接呈现模板。使用link_to rails呈现模板3.1
下面是我在做什么: -
link_to "Profile", render :template => "profile"
这给了我一个错误: -
SyntaxError in Settings#account_setting
这里是我的设置控制器: -
class SettingsController < ApplicationController
before_filter :authenticate_user!
def profile
@user = current_user
request.method.inspect
if request.method == "POST"
@user.update_attributes(params[:user])
flash[:notice] = "You updated your profile successfully."
end
end
def account_setting
end
end
这是错误: -
syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' on this line %li=link_to"profile", render :template => "profile"
这是错误的生成的标记: -
syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' ...se((link_to("profile", render :template => "profile"
可能是什么问题?
它是什么样的偏方?展示下。 – 2012-01-16 12:51:21
@SergioTulentsev更新了错误 – 2012-01-16 12:51:40
你想不要重新加载页面吗? – 2012-01-16 12:55:27