【发布时间】:2012-02-11 09:48:23
【问题描述】:
我正在尝试通过单击链接来呈现模板。
这是我正在做的事情:-
link_to "Profile", render :template => "profile"
这给了我一个错误:-
设置中的语法错误#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
这是错误:-
语法错误,意外的 tSYMBEG,在这一行需要关键字_do 或 '{' 或 '(' %li=link_to"profile", 渲染 :template => "profile"
这是生成的错误标记:-
语法错误,意外的 tSYMBEG,需要关键字_do 或 '{' 或 '(' ...se((link_to("profile", render :template => “个人资料”
可能是什么问题?
【问题讨论】:
-
是什么偏方?显示它。
-
@SergioTulentsev 更新了错误
-
你想在不重新加载页面的情况下这样做吗?
-
@SergioTulentsev 我只希望页面是否重新加载无关紧要
-
生成的标记是什么样的?
标签: ruby-on-rails ruby-on-rails-3.1