2011-10-05 70 views
0

這是在控制器中我得到的代碼錯誤請幫我錯誤在控制器文件Rails3中

class HomeController < ApplicationController 
    respond_to :json 

    def index 
    @home = Home.all 

    respond_with(@home) 

    cookies['AFID'] = { 
     :value => request.env['AFID'], 
     :expires => 1.year.from_now 
    } 


    cookies['SID'] = { 
     :value => request.env['SID'], 
     :expires => 1.year.from_now 
    } 

    #cookies[:AFID] = { :value =>} 

    end 


    def create 
    @homes = Home.create(params[:home]) 

    respond_with(@home, :location => users_url) 
    end 
end 

我得到了以下錯誤的HomeController#指數 NameError

+0

你能發佈有關錯誤的更多信息嗎?截圖或只是文本? – Bohdan

回答

0

首先,請使用Ruby約定的代碼縮進!

如何修復: value => request.env['AFID'],:value => request.env['AFID'],?這有幫助嗎?