Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails4 undefined local variable or method map #55

Open
bodaonline opened this issue May 4, 2015 · 5 comments
Open

rails4 undefined local variable or method map #55

bodaonline opened this issue May 4, 2015 · 5 comments

Comments

@bodaonline
Copy link

Hi All,

I am new to Rails. I tried to setup routing-filter with basic settings as per seen in the wiki/Localize_filter but go this error when starting the server:

/home/ubuntu/workspace/stuff/config/routes.rb:18:in block in <top (required)>': undefined local variable or methodmap' for #ActionDispatch::Routing::Mapper:0x0000000852e2e0 (NameError)

I have this in routes.rb:

Rails.application.routes.draw do
  map.filter 'locale'
  root 'static_pages#home'
  resources :categories
  resources :users, only: [:index, :show]
  resources :items
  devise_for :users
  get 'users/index'
  get 'users/show'
  resources :addresses do
     collection { post :import }
  end
end

I have set up routing.rb, application-controller.rb, environment.rb as per described in the Wiki.

@simi
Copy link
Collaborator

simi commented May 4, 2015

What version are you using?

@bodaonline
Copy link
Author

0.5.0

@fabn
Copy link

fabn commented May 22, 2015

That wiki page refers to rails 2 documentation, there's no need to use map.filter you should replace it in your code with:

Rails.application.routes.draw do
  # map.filter 'locale'
  filter :locale
  # ...
end

@simi
Copy link
Collaborator

simi commented May 22, 2015

Ahh, I missed that @fabn. @bodaonline does this work for you?

@bodaonline
Copy link
Author

Hi @fabn and @simi !
Thanks for your reply but no luck. I guess if that wiki page is for rails2 there are other mines in it. Know of any uptodate guide? TIA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants