Coder Social home page Coder Social logo

Comments (9)

jcf avatar jcf commented on July 1, 2024

Looks like you're trying to define a root route.

map.filter 'locale'
map.root :controller => :homepage, :action => :show

Try that instead and see if your error goes away.

from routing-filter.

edelmasure avatar edelmasure commented on July 1, 2024

Yups, I realize there has been a truncation while copy / pasting my route.rb head of code.
Here is the real one, having the same effect, and the error message well targets the line number 2. Sounds like filter route is interpreted as a named route, and expected to have a :controller association ?! Could I miss some configuration that affects the regognition of the routing-filter library ?
I just installed the gem, and wrote the map.filter directive in route.rb, as explained by the authors... (I'm working with NetBeans 6.8).

Regards,

Ed.
ActionController::Routing::Routes.draw do |map|
map.filter "locale"
#map.connect "", :controller => "homepage", :action => "show"
#map.root :controller => "homepage", :action => "show", :path_prefix => "/:locale"

from routing-filter.

edelmasure avatar edelmasure commented on July 1, 2024

Arf', be sure there are new lines between each route definition :-), I can't make that #$@! copy-paste keep my code format...

from routing-filter.

edelmasure avatar edelmasure commented on July 1, 2024

...and removing map.filter produces no error... but I can't benefit the path prefix managing convenience.

from routing-filter.

jcf avatar jcf commented on July 1, 2024

You need to require the gem as well as install it in your Gemfile if you're using Bundler or config/environment.rb if not.

from routing-filter.

jcf avatar jcf commented on July 1, 2024

If you don't know how to add a gem dependency to your Rails app there are instructions on http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies.

from routing-filter.

jcf avatar jcf commented on July 1, 2024

And if you want to insert a code block use four spaces before a line like this…

Ruby.is_much_better_than?(Java)
DHH.translate(MIT_LICENSE)

from routing-filter.

edelmasure avatar edelmasure commented on July 1, 2024

Thank you ;-)
I was quite convinced I should declare something somewhere... but coming from J2EE RoR seams so magically human-friendly... I still have difficulst to discern dreams and reality !
Anyway, thank you for helping me in my first steps in RoR world ,-) !

Best Regards,

Ed.

from routing-filter.

edelmasure avatar edelmasure commented on July 1, 2024

just 'forgot to close...

from routing-filter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.