我想通過單擊鏈接呈現模板。使用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