routes

CakePHP 1.3 Plugin Shortcut Route

Hi, I searched a lot around the web but I couldn't find any specific sollution to this. In CakePHP 1.3, different from 1.2, if you had a controller inside a plugin, and both had the same name, you could access through "<plugin>/<action>", and it would call the 'default' controller. But in 1.3, according to this: http://cakeqs.org/eng/q...

CodeIgniter 404 Page Not Found, but why?

Hello I am using CodeIgniter for two applications (a public and an admin app). The important elements of the document structure are: /admin /admin/.htaccess /admin/index.html /application /application/admin /application/public /system .htaccess index.php The /admin/.htaccess file looks like this: DirectoryIndex index.php RewriteEngi...

mvc.net routing: routevalues in maproutes

Hello everyone, i need urls like /controller/verb/noun/id and my action methods would be verb+noun. for example i want /home/edit/team/3 to hit the action method public ActionResult editteam(int id){} i have following route in my global.asax file. routes.MapRoute( "test", "{controller}.mvc/{verb}/{noun}/...

Ruby on Rails 3 Routes Question

When clicked on the link below, it takes me to the show screen, instead of deleting the thing. <th><%= link_to 'Destroy', blog, :method => :delete %></th> Controller def destroy @blog = Blog.find(params[:id]) @blog.destroy respond_to do |format| format.html { redirect_to(root_path) } format.xml { hea...

Recommended Lists Of Reserved Words For User-Generated URL Components

I am in the process of creating a web app. Since I admire the directness of Twitter's URL scheme for user pages, I'm trying to emulate them. I'd like my users' profile pages to be available at http://myapp.com/user_chosen_identifier. Right now I have some basic code for ensuring RFC3305 compliance with what I put in a URL, but I'm more...

Rails: what is wrong with this route?

For some strange reason cardsets_path('my') generates "/cardsets.my" instead of "/cardsets/my". Please explain why? config/routes.rb: match '/cardsets/:type', :to => 'cardsets#index', :requirements => { :type => /my|public/ }, :as => 'cardsets' resources :users do resources :cardsets do end end rake routes: cardsets /cardsets/:...

asp.net mvc2 Routes

Hi, So I have added this route to my map: routes.MapRoute( "Default", "/Bikes/{id}", new { controller = "Bike", action = "Detail" } ); But for SEO reasons we need to have urls like: /bikes/54/name-of-bike/kind-of-bike/number-of-wheels ... etc etc. But everything after id (54) can be ignored. Does a...

How do I map all actions for a controller to the top-level in Rails?

Whenever I develop sites using Rails, I create a controller called "front" which has actions like "index," "how," and "about." So, the home page, "How It Works," and "About Us" pages can be accessed via /, /how/, and /about. My routes look like this: map.root :controller => "front", :action => "index" map.connect 'how', :controller => ...

How to Create This Route in CakePHP

I want to create a route something like: http://images.example.com/[models]/[sizes]_[filename].[extension] [models] = (blog|event|user) [sizes] = (t|s|l|o) [filename] = example [extension] = (png|gif|jpg) How do I create the route for this? I've tried the following w/ no success: Router::connect('/:model/:size\_:filename.:extens...

Are default routes broken with Rails 3 engines?

I have a Rails 3 engine gem that is for basic user authentication and authorization. Within that Gem the config/routes.rb defines the following resources :users match '/:controller(/:action(/:id))' When I do a rake routes from the application that requires this gem I get the following routes rake routes|grep users users GET /users(...

ASP.Net MVC Form action in returned View

Hi there, Will keep this as simple a possible:- I have a have a controller which will return either ViewA or ViewB - e.g. [HttpPost] public ActionResult ViewA(BlahModel model) { if (isTrue) return View(model); else return View("ViewB", model); } ... The problem I have is that ViewB has a form on it. And what hap...

How do I set up a named route in rails 3?

This is a month long thing I've been putting off, and I can't for the life of me figure this bugger out. I'm tracking to access a file in website/admin/organizations/org_deals My routes look like this : map.namespace :admin do |admin| admin.namespace :organizations do |organization| organization.org_deals 'org_deals', :action =>...

Rails: resources for unorthodox urls?

Hi! I'd like to have a URL like this: /payroll/region/1 and I'd like it to map to the Tasks Controller's payroll_list function. I'd also like to use REST. What's the best way to do this? Many thanks! ...

Rails: Route for :collection that is both GET *and* POST?

I have a route that currently looks like this: map.resources :regions, :collection => {:select_for_payroll => :get}, has_one => :payroll How can I make the :select_for_payroll take both GET and POST? Many thanks! MrM ...

Devise logged in root route rails 3

Heyya guys. So i thought about this coolio idea, if you are logged in then you get some sort of dashboard, else you get an information/login/sign up page.. So how do i do that.. I mostly wants to do this in Routes = not something like def index if current_user.present? render :action => 'logged_in' else render :action => ...

Change scope of :new action in Rails3 routes to :member

I need to match /entries/slug-here/new and send it to EntriesController#new Tried following ways, both didn't work :( resources :entries do member do get :new end end resources :entries do get :new, :on => :member end Temporary hardcoded paths with bunch of matches, but it looks ugly >.< UPDATED: Same with create method ...

[model]_path generator for named route adding parameters in [model] view

Hallo I have a named route: map.notes '/notes/:id/:from_date/:to_date', :controller => "users", :action => "notes", :defaults => { :from_date => nil, :to_date => nil } When I create a path for this route in any other model or when using the route without the additional parameters (/notes/1) i get the expected url generated: notes_pa...

rails problem with routing and constraints

I have a problem with routing with an id conditioned by a regex constraint. My route is: resources :albums, :constraints => { :id =>/[a-zA-Z\d\.\-\_]+$/ } do get :offline, :on => :member end If I do this: GET /content/v1/albums/:id(.:format) {:action=>"show", :controller=>"content/v1/albums", :id=>/[a-zA-Z\d\.\-\_]+$/ It w...

Overriding a resource route to / (root) in Rails3: not changing the path helper?

Hi, I am quite new to Rails3, I basically created a subscribers scaffolding, I only want my app to respond to new and create actions. So in config/routes.rb I defined: resources :subscribers, :only => [:new, :create] Which works this way GET /subscribers => subscribers#new POST /subscribers => subscribers#create Now I want my a...

Ruby on Rails. Unicode routes

Hi. Is it possible to set a Unicode string as a segment of a path in Rails? I try the following: # app/controllers/magazines_controller.rb class MagazinesController < ApplicationController def index end end ...