Questions tagged [custom-routes]

198 questions
2
votes
1 answer

How to translate root specific resource declaration from Rails 2 to Rails 3?

I'm migrating an application from Rails 2.3.5 to Rails 3.2.8. I have this route from the Rails 2 app that is giving me headaches: map.resources :soumission_vt, :path_prefix => "/soumission/VT/:page_id", :as =>…
2
votes
0 answers

How do I create a complete list of valid routes (api endpoints)?

What I have done is use Library::locate to find controllers, calling Router::match on them based on a whitelist property. I also have a shared controller that many models use and I use locate on models with a whitelist there. This is sort of…
Alexander Morland
  • 6,356
  • 7
  • 32
  • 51
1
vote
2 answers

Custom routes in rails

I have a users controller. For a specific user I want to have something like this example.com/a_constant_string ==> example.com/users/2 I just need for a specific user, not for all users. You can say link_to 'Go to a specific user', @user link_to…
Mohit Jain
  • 43,139
  • 57
  • 169
  • 274
1
vote
1 answer

change routes in devise

Im working with ruby 1.9.2, rails 3.1.3, devise 1.5.3, I need to change the devise routes, I already changed the default routes, like login and logout, but I need to change the others routes, for example: http://localhost:3000/password/new I need…
suely
  • 334
  • 1
  • 8
  • 19
1
vote
1 answer

Rails 3 custom route not recognized by *_path method

Is there a way to make sure a custom route is recognized by the *_path method? I've got a resource, and a custom route to the same controller: resources :news, :only => [:index, :show], :path => :nieuws match '/nieuws/:cat/:id/:slug', :to =>…
1
vote
1 answer

routing to page name

is there a way i could route - http://localhost:3000/pages/1 to http://localhost:3000/home and all the other pages in my site i.e. - http://localhost:3000/pages/4 to http://localhost:3000/contact-us automatically? I can do this the other way around…
1
vote
1 answer

ASP.Net MVC Routes - eCommerce Categories (root, and sub categories)

I'm developing an ecommerce application, using ASP.net MVC 3 Having some trouble figuring out the best way to map "categories" For each category, I have a root page - that will display some offers, info, etc.. (these are examples) /books /clothes…
Alex
  • 37,502
  • 51
  • 204
  • 332
1
vote
1 answer

Kohana Route for blog posts not working

While I was learning kohana and making single article, i encountered this problem. I wanted to get my url to look like article/post_id/slug(optional) so I made the route. Route::set('article',…
Raimonds
  • 2,606
  • 3
  • 20
  • 25
1
vote
1 answer

How to give a different view for each user in Rails 3?

So I have my table users and each record has a username field and I have my root to controller main and action `index root :to => 'pages#main' so if go to http://mydomain.com It'll show my main#index page and i have the about and contact pages as…
Mr_Nizzle
  • 6,644
  • 12
  • 55
  • 85
1
vote
1 answer

Adding custom route to routes file Rails 2

I want to be able to do the following: change_pass_user_path(usuario) in a "link_to" (for example). where "change_pass" is the name of my action inside de "user" controller. I already added this: map.resources :users to my routes file. (so I'm…
tiiin4
  • 539
  • 4
  • 7
  • 19
1
vote
1 answer

Use POST or GET Request From Static URLs in Template in Rails

Please bear with me, as I'm new to programming in Rails and in general. I have a very limited understanding of how the models, views, controllers function but I've been learning as fast as I can. I am having trouble with how I can generate…
Scott
  • 11
  • 1
1
vote
1 answer

How to execute page methods when using custom route handlers?

When the path refers to the actual folder structure and points to the page it's not a problem, i.e. "/Default.aspx/MyMethod", however if "/" brings up "Default.aspx", then "/MyMethod" means something different. Is it even possible at all? A possible…
Shagglez
  • 1,522
  • 3
  • 21
  • 38
1
vote
1 answer

Problem calling a controller method from view

I have a Books Controller with the following methods: books_controller.rb def set_as_reading if (user_signed_in?) if (current_user.user_type == "0") @book = Book.find(params[:id]) @reading = Reading.new …
1
vote
1 answer

Drupal-like routing system in Rails

I am trying to find a best-practice to allow users to define the route to their pages in Rails, by writing them in a text field when submitting posts, like with the Path module in Drupal (yes, we are porting a Drupal site to Rails) So, I need…
Houen
  • 1,039
  • 1
  • 16
  • 35
1
vote
2 answers

How to create a route with custom port in Rails 5?

I'm trying to create a dedicated health check route that uses a different port (3001) in Rails 5. my route should just render the text response "Up and running" but use a port different to the default app port while the app runs on the default port…