routes

Problem viewing photos in Paperclip - routes error

I have set up Paperclip and ImageMagick successfully on my system, and files are uploading correctly, being resized, and and being saved into the right folders. I try to display those images in my view: <%= image_tag @customer.logo.url(:medium) %> No image is displayed. When I go to the image's direct url I get: Routing Error No rou...

Devise named_routes problem

I'm having a problem with some devise routes. The session named routes have the actions in the rong place. It should be 'new_admin_session' and 'destroy_admin_session', but instead it's 'admin_session_new' and 'admin_session_destroy'. Anyone know what's happening? admin_session_new GET /admin/sign_in(.:format) {:a...

How to add aditional rest routes to a nested resource in rails

I have a widget that has many links. In the routes file: map.resources :widgets, :has_many => [:links] I want to add a "sort" action to links. What do I need to add to the routes file, so I can write sort_widget_links_path(widget) Thanks, Deb ...

Defining :id in routes to be something other than id in rails 3

I am porting a Merb app to Rails 3. In Merb we could put an Identify block around a route to define how an :id route parameter was to be supplied, e.g., # this is a Merb route that I want to port to Rails 3 routing; I get everything except # how to replicate the behavior of Merb's Identify block which doesn't require one to # futz wit...

hyphen in rails 3 route

I would like to do the following match "company/client-list" => 'companies#list' however, when I do, my routes table entry doesn't name the route, like so. /company/client-list(.:format) {:controller=>"companies", :action=>"list"} as soon as I remove the hyphen in the matched route, it behaves as expected company_cl...

Codeigniter Routing not equal to pattern

Hi there I am working on a codeigniter app and am having some trouble wrapping my head around a routing issue. Basically I would like all routes to map to an specific controller action by default, but I would also like to able to specify an array of routes (or ideally initial url segments) which shouldn't follow this pattern. By way ...

Rails 2.3.5: How do I add an :id field to a namespace?

I want to have an admin area. So I wrote: map.namespace "admin" do |admin| admin.resources :cities admin.resources :links end But I would like to the admin area for a specific location. I am looking for something like: map.namespace "admin/:location_id" do |admin| admin.resources :cities admin.resources :links end what wo...

Question about URL friendly links

Hi, I am trying to get my urls to look like this: example.com/posts/id_of_post/title_of_post I have this in my controller: match ':controller/:id/:link', :controller => 'posts', :action => 'show' Say I have a list of posts.. how can I link to them? <%= link_to 'Show', post %> Just gives the usual /posts/id On another note, at t...

Routes/Pylons Fails Before Touching My Code

I am very puzzled over this error. In a previously functional Pylons app (running on apache/mod_wsgi), Routes has exploded. When I attempt to access my application, no matter what URL I use, I get the Apache "Internal server error" page and the following traceback in /var/log/apache2/error.log. [Sat Oct 02 2010] WSGI Variables [Sat ...

How do I specify a default parameter value for a Pylons action?

I have an action which looks like this: class ArticleController(BaseController): def all(self, page, pagesize): I want to be able to access /article/all/{page}/{pagesize}, with default values for page and pagesize. I tried setting the default values in the action method, but then apparently both page and pagesize get set to the d...

.net MVC 2 default Route suddenly stopped working

Hello, today the default route for my site stopped working, but the strange thing is that the global.ascx has not changed at all. when i enter the URL mysite.com/ i get this 404 error The resource cannot be found. Requested URL: /Views/Start/Index.aspx i have a bog standard default MVC route routes.MapRoute( ...

Rails3 subdomain routing

I am trying to port over my Rails 2.3.5 app to Rails 3, and having trouble with the following route configurations: ActionController::Routing::Routes.draw do |map| map.app '', :controller => 'projects', :action => 'index', :conditions => {:subdomain => true} map.with_options :controller => 'site', :action => 'page', :sub...

How can I change the ActionLink behavior?

Been new to MVC 2, how can we get a link as: http://localhost:13269/Terms instead http://localhost:13269/Frontend/Terms as this is the result of: <%: Html.ActionLink("Terms & Conditions", "Terms", "Frontpage")%> even if I don't specify the Controller like <%: Html.ActionLink("Terms & Conditions", "Terms")%> as I changed the rou...

Rails 3 routes with extended regex :constraints - bug?

I have the following route in my Rails 3 app. post 'games/:id/:task/:card_id' => 'games#perform', :as => :perform ...which allows, obviously, such requests as button_to("Foo", {card_id=>2, :action=>:perform, :task=>"foo"}), mapping to the URL /games/1/foo/2. I'd like to restrict the set of tasks the route matches. The Rails API docs ...

Two symfony routes with same url?

Is it possible two have to symfony routes (sfDoctrineRoute) with same url ( /:sf_culture/:slug/), but different model? ...

member and collection

Can anyone tell me about collection and member in routes??and In which conditions these are used? ...

Using Zend_Controller_Route to automatically determine the controller based on the user role: how?

I am currently figuring out a way to the the above. My current application structure is as follows: /modules / modulename /controllers /ProjectController.php The application has 3 different user roles, each with functionality contained within these modules. I'd like to prevent having multiple actions for each user role in one...

Zend framework module, controller, action specific routes

Hi, In my zend framework application, I have routes and defaults like: resources.router.routes.plain.defaults.module = "index" resources.router.routes.plain.defaults.controller = "index" resources.router.routes.plain.defaults.action = "index" I want to be able to change default routes for any module or controller or action e.g. Let'...

Find the list of defined sammy.js routes

Sammy.js is a controller library in javascript. But sometimes we have a 404 because our route doesn't seems to be valid to sammy. How to know which route are defined by Sammy.js in a page ? Something like the ruby on rails' rake routes. Like answers we can search on app.routes. So I have something like in coffee script : jQuery.each...

Zend Framework route chaining in application.ini

I am setting language depending on the domain name (en for en.example.com, tr for tr.example.com): resources.router.routes.plain.type = "Zend_Controller_Router_Route" resources.router.routes.plain.route = "/:module/:controller/:action" resources.router.routes.plain.defaults.language= "en" resources.router.routes.plain.defaults.module = ...