Questions tagged [custom-routes]

203 questions
2
votes
1 answer

Specific Ruby on Rails routes deliema

Currently developing a RoR mobile web application for displaying information about particular places. Let's call these places 'installations'. Each installation has at least one 'venue', which is a specific instance of the installation. So for…
Gowiem
  • 1,009
  • 15
  • 17
2
votes
2 answers

Rails 3.0.10, customer routes, post and form_for tag

I have this in my routes: resources :events do collection do post 'moderate' end end Rake routes tells me: moderate_events POST /events/moderate(.:format) {:controller=>"events", :action=>"moderate"} I have an "administration" controller…
Jez Caudle
  • 183
  • 1
  • 7
2
votes
2 answers

How to replace "-" with "_" in url before mapping a controller and an action in a .net mvc3 application

Hello everyone :I am working on a .net mvc3 application. Here is my controller and action : public class Foo_Bar : Controller { public ViewResult Foo_Bar() { return View(); } } And my corespondent view file is :…
NextStep
  • 925
  • 3
  • 11
  • 18
2
votes
1 answer

Retaining parent slugs in CakePHP

I'm experimenting with SEO friendly URL's in CakePHP as efficiently as I can, I've managed to use the current format, each example uses function view($slug) except for the first example which uses function…
G3vie
  • 21
  • 1
2
votes
1 answer

Rails 3 routing with resources under an optional scope

I have setup my versioned API like this with only a small tweak for backwards compatibility. In my routes I have: scope '(api(/:version))', :module => :api, :version => /v\d+?/ do … scope '(categories/:category_id)', :category_id => /\d+/…
coneybeare
  • 33,248
  • 21
  • 128
  • 182
2
votes
2 answers

"No route matches" error in Rails 3 when invoking own controller method from view (POST)

Rails champions I've been programming with Ruby and Rails 2.x for quite a while and while I'm certainly not proficient in Rails, I'd still say that I had a nice grasp of the framework and the tools. However, I am currently working on my first Rails…
2
votes
1 answer

Asp.net MVC putting # in the url

We are using Asp.net MVC, one of our requirement is to put '#' in the url something like www.xyz.com/a-to-b/#date i have registered the route below, it works fine for 'to' in the url but using # before the date i get a null data back. Is '#' some…
Miral
  • 5,898
  • 15
  • 54
  • 84
2
votes
1 answer

Ruby on Rails - Creating a Custom Route to #Show

I am still making my cookbook app, Im to the point to where I am building out the grocery list feature where you will be able to click a link "Add to Grocery List" and it will add all the ingredients from a given recipe to a grocery list on a new…
jammer
  • 73
  • 6
2
votes
1 answer

Rails 4 form_for giving incorrect action for patch route

I'm building a simple CMS as a first exercise to learn Rails. I've created a Pages model and adjusted the routes so the show action is domain.com/:id and all the other actions are domain.com/admin/pages/:id. My routes look as I expect when I run…
patnz
  • 1,089
  • 3
  • 14
  • 23
2
votes
2 answers

Rails default routes through resources implementation

resources :photos Creates seven different routes, all mapping to the Photos controller. GET /photos GET /photos/new POST /photos GET /photos/:id GET /photos/:id/edit PATCH/PUT /photos/:id DELETE /photos/:id But where…
abcd_win
  • 107
  • 5
2
votes
1 answer

Custom Route to Custom Page in Rails 4

I have an app with a parent resource (has_many) of patterns and a child resource (belongs_to) of snippets. My desire is to build a couple custom routes to specific pages and I am wondering the best way to do that. For now, here is what I have that…
2
votes
3 answers

ruby on rails: how to change the routing address

I am new to rails and I would like to know that if there is a way to change the name of the routes. I will explain the sentence in a minute. I have a controller named users_controller and below is the code that I have in my controller: def create …
chaitanya90
  • 677
  • 1
  • 8
  • 20
2
votes
2 answers

ASP.NET MVC - About Constraints in Routes

I'm having difficulty using a constraint on a custom route. The following is my class RouteConfig.cs public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { …
Igor
  • 2,303
  • 3
  • 27
  • 49
2
votes
3 answers

Routing Error :: No route matches [GET] "/static_pages/about"

I am getting this error while going through the tutorial by Michael Hartl. Section 5.3.2 (Rails routes). Content of my routes.rb file is SampleApp::Application.routes.draw do root 'static_pages#home' match '/help', to: 'static_pages#help', …
Abhinay
  • 1,713
  • 4
  • 25
  • 49
2
votes
1 answer

Rails 3.1 Multitenancy routes

I have a Rails 3.1 multi-tenancy app with a domain that I'll call mydomain.com. With this I would like to create the following routes but keep coming unstuck default root for www.mydomain.com and mydomain.com should go to a controller called home or…
Michael Moulsdale
  • 1,408
  • 13
  • 32
1 2
3
13 14