我创建了一条路线:
user_currency GET /user/currency/:currency(.:format) user#currency
这是我的用户控制器:
class UsersController < ApplicationController
require 'will_paginate/array'
require 'gdata'
before_filter :ensure_user_friendly_url, :only => [:show, :following, :followers, :friends, :designers]
before_filter :check_if_signed_in, :only => :signup
以及路线的控制器:
def currency
session[:currency] = params[:currency]
redirect_to :back
end
我收到一个错误:
uninitialized constant UserController
错误发生在这里:
- currency_values.each do |currency|
%li
= link_to "#{currency.country}", user_currency_url(currency.id)
我currency_id
作为货币传递。