Coder Social home page Coder Social logo

No route matches "/" about routing-filter HOT 3 CLOSED

svenfuchs avatar svenfuchs commented on July 1, 2024
No route matches "/"

from routing-filter.

Comments (3)

hukl avatar hukl commented on July 1, 2024

use the :scope feature of the rails3 router if you only need the locale functionality

from routing-filter.

tsdbrown avatar tsdbrown commented on July 1, 2024

I've tried that but don't know how to make it so that if a locale isn't passed in the URL the route will still work using the default locale. With the scope it simple doesn't match. Do you know if it's possible to make it optional?

This filter seems to handle it. I don't really want to define all my routes twice or force the usage of /en etc everywhere.

Any thoughts would be much appreciated!

from routing-filter.

tsdbrown avatar tsdbrown commented on July 1, 2024

I've just stumbled across this:

This is an optional path scope that allows to have a prepended path before a resource:
scope '(:locale)', :locale => /en|pl/ do

And it works exactly how I would like. Cannot believe I didn't spot the options path segment before!

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.