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…
![](../../users/profiles/1159410.webp)
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…
![](../../users/profiles/415928.webp)
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 :…
![](../../users/profiles/987000.webp)
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…
![](../../users/profiles/751573.webp)
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+/…
![](../../users/profiles/69634.webp)
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…
![](../../users/profiles/669734.webp)
windstrewn
- 51
- 4
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…
![](../../users/profiles/55891.webp)
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…
![](../../users/profiles/5037861.webp)
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…
![](../../users/profiles/441164.webp)
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…
![](../../users/profiles/1129729.webp)
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…
![](../../users/profiles/3585778.webp)
benjoco
- 23
- 3
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
…
![](../../users/profiles/3386734.webp)
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)
{
…
![](../../users/profiles/2145555.webp)
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', …
![](../../users/profiles/2545197.webp)
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…
![](../../users/profiles/1878128.webp)
Michael Moulsdale
- 1,408
- 13
- 32