similar to: extending routes in Rails 3 plugin

Displaying 20 results from an estimated 100000 matches similar to: "extending routes in Rails 3 plugin"

2010 Apr 27
4
Translated (language-aware) routes in Rails application
Hi, I''d like to have translated languate-aware routes in my application, like: /projects/5/permissions => locale "PL" /projekty/5/pozwolenia => locale "PL" Is there any way to achieve it with RESTful routes? I have done it manually with named routes, but it''s overwhelming with over 300 routes :D Also tried namespace (yeah, didn''t work) and
2011 Oct 06
0
Rake Routes Blank on upgrade to Rails 3
I have just upgraded an app to rails 3 following the railscast screencast. I have installed a blank application inside the app to be upgraded with: rails new . I have replaced all the the main files. When I run rake routes I get no output. routes.rb: App::Application.routes.draw do resources :products end (ie, just the default file with an example uncommented) I have tried a number of
2010 Aug 12
4
[Rails 3] How to test routes urls in console
I tried require ''url_writer'' but this is not the trick what should be required/included to test the routes urls ? thanks erwin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this
2011 Oct 05
3
Rails 3 routes with same name, different param name based on constraint
Hello there fellow RoR enthusiasts, I have been wrestling with rails 3 routes for hours trying to accomplish the following: I want to use the *same url helper* (photo_url) in my views but have a different route match made depending on the format of the parameter I pass. Seems simple enough, right?? If the parameter looks like nn.nn.nnnnnn.whatever, I want the param passed to
2010 May 23
1
[Rails 3] Trouble with named routes and form_for
Hi guys, I''m having trouble getting named routes and form_for to play nicely in quite the way I would expect. Here''s a quick summary of what I''ve got going on: Named route: resources :thread, :class_name => "forum_thread" Controller name: forum_thread_controller Model object: forum_thread In both my new and edit actions I''m setting up an
2011 Jun 21
0
Status of Rails.application.routes.recognize_path()
This might be more a question for the guys in the "Ruby on Rails: Core" group, but I''ll try it out here first... So, while writing a gem (engine) for rails, I found that I needed to have my app (in a pre-filter) directly query the router. In the "old" days, this was done using ActionController::Routing::Routes.recognize_path(). My 2nd edition of "Agile Web
2010 Mar 27
2
Shorter Rails 3 routes
Hi, I have a small blog application, and I would like to shorten its routes. Here they are: Blog::Application.routes.draw do resources :categories do resources :articles do resources :comments end end A rake routes command produce the following lines: GET /categories/:category_id/articles/:article_id/comments(.:format)
2012 Jul 18
0
Rails 3.1 Optional Routes
Hi all, I am using Rails 3.1 and Ruby 1.9.2 In my application i am using optional routes like below match ''Gallery(/:gallery_id(/:image_id))(/page/:g_page)'' => "wps/ gallery#show_gallery_page",:as => :gallery_page in console i am trying to call the routes like below include Rails.application.routes.url_helpers => Object 1.9.3dev :002 > gallery_page_path
2012 Feb 01
0
Rails 3.1 form & routes.rb [newbie]
Hi all, maybe is a newbie question anyway 1. I create de rails app with # rails new {my app} 2. after I add some gem to my Gemfile source ''http://rubygems.org'' gem ''rails'', ''3.1.1'' gem ''sqlite3'' gem ''simple_form'' gem ''execjs'' gem ''therubyracer'' # Gems used only
2012 Feb 12
3
Rails routes - destroy
Can''t figure out how duplicate routes are differentiated by rails ... Read routing from inside out and API as well as a few tutorials but still don''t get it!!! For example... routes.rb resources :minisections do resources :questions end rake routes: minisection_question GET /minisections/:minisection_id/questions/:id(.:format) questions#show
2011 Jul 28
2
rails 3 routing error
Here''s the error: 1) SessionsController GET ''new'' should be successful Failure/Error: get :new ActionController::RoutingError: No route matches {:controller=>"sessions", :action=>"new"} # ./spec/controllers/sessions_controller_spec.rb:8:in `block (3 levels) in <top (required)>'' 2) SessionsController GET
2010 Feb 20
2
Extending Rails
Hi, I am not sure how to extend Rails. I want to write a class where I can Access my Models, like "User.all". I tried to add a class in the lib/ folder but then ruby complains that e.g. "User.all" with "NameError: uninitialized constant " Is there a way to inherit my Rails functionality in a ruby class in the /lib folder? Or am I going in the conplete wrong
2011 Jul 25
3
Rails 3.1 Engines: Full vs. Mountable
Hi all, I was hoping someone could please clarify the differences between a full engine and a mountable one. I have noticed the following: ** Full Engine ** - With a full engine, the parent application inherits the routes from the engine. It is not necessary to specify anything in parent_app/ config/routes.rb. Specifying the gem in Gemfile is enough. The engine routes are specified as: #
2010 Dec 29
5
Beginer: Question about routing on Rails 3
I bought this book about rails for beginers (head first Rails) and its quite simple and good for someone who has no clue about Rails (or any other language) On chapter two it talks about routing but unfortunately the book is for rails 2 and i have rails 3 installed on my mac. The line i have to enter in the config/routes.rb of my application is: map.connect ''/ads/:id'',
2010 Jun 21
4
Failing Routes in deployment
I have an app that has the following in the routes file: namespace "admin" do # ADMINISTRATIVE ROUTES ONLY root :to => ''home#index'' resources :comments do member do get :approve get :reject end end resources :users do member do get :block get :unblock end end end When browing to
2010 Nov 10
1
rails "path_prefix" produces no correct verb route evaluation
Hi guys! ;) If you set "routes.rb" as: map.resources :pocoyo You have RESTful rails routes facilites. Ok, let''s focus on these two maps: "http://domain.com/pocoyo" [GET] is mapped to "pocoyo" controller and "index" action. "http://domain.com/pocoyo" [POST] is mapped to "pocoyo" controller and "create"
2010 Jul 09
0
Uncountable nouns in resource routes with Rails 3
I have a model called Aircraft, inflected as uncountable, and it''s driving me nuts. What is the correct way to handle this in Rails 3 beta 4? resources :aircraft do member do get :flights end end # Of course these work for some actions and not others. match ''aircraft'', :to => ''aircraft#index'', :as =>
2010 Mar 23
1
:has_many and :controller specified in routes.rb
Have an app using older version of Rails (2.3.2) that I need some routing assistance with if anyone has a minute. The app was originally designed to be purely html view, and an xml and json api was hacked on. To keep it clean, we are now moving the first version of the api (v1) under its own directory (v1) under app/ controllers but still responding to the old paths. One of the parts of the new
2011 May 06
3
Rails 3 Routing problems
I have an UploadsController and UsersController where Users'' has_many :uploads'' via polymorphic attachment in uploads.rb. Now we i navigate to http://localhost:3000/users/1/uploads I get re-routed to Uploads#index and rendered is called multiple times as shown below: Started GET "/users/1/uploads" for 127.0.0.1 at 2011-05-06 22:00:38 +0100 Processing by
2012 Oct 18
1
routing issue with mounted engine - Rails 3.2.8
I mounted the Forem::Engine in my app MyApp::Application.routes.draw do scope "/:locale" do ... resources :sites, :only => [:none] do get ''home'', :on => :collection get ''events'', :on => :collection end .. mount Forem::Engine, :at => "/forums", :as => :forums, constraints: lambda { |r|