similar to: Status of Rails.application.routes.recognize_path()

Displaying 20 results from an estimated 4000 matches similar to: "Status of Rails.application.routes.recognize_path()"

2011 Jun 22
3
Status of Rails.application.routes.recognize_path()
Sorry if this question isn''t really "Ruby on Rails: Core" material. I feel it is, at least kind-of (also, I first tried asking in "Ruby on Rails: Talk" to no avail.). 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
2011 Jan 10
0
Can't use ActionDispatch::Request in Rails middleware because path_parameters get lost
Hi, I just encountered a bit of an issue where we call request.params of an ActionDispatch::Request inside a rack middleware right before a Rails 3.0.3 app. The issue is that the path_parameters never appear in the parameters hash if you call request.params before the rails app. It seems that that the requests.params method memoizes itself in "action_dispatch.request.parameters"
2007 Feb 10
3
recognize_path discrepency
hey all - wondering if someone would relive my confusion... given a model called say Meeting and a route as "map.resources :meetings" in the console: >>r=ActionController::Routing::Routes >>r.recognize_paths "/meetings" =>{:action="index",:controller=>"meetings"} all works as I expect, but if I do >>r.recognize_paths
2009 Mar 06
2
Routes.recognize_path on more complicated Routes
For a permissions system i''m writing i''m extending the standard link_to helpers to check if a user has a permission to perform that action before displaying a link to clean-up my code so i don''t have to put if checks all over them. I''m trying to use.. ActionController::Routing::Routes.recognize_path(url, :method => method) to get the action and controller
2006 Oct 03
0
rs.recognize_path "/home" is not working in script/console
My application runs fine. I just want to change a few routing rules and I decided to test using script/console. But I''m getting following error. Loading development environment. >> rs = ActionController::Routing::Routes >> rs.recognize_path "/home/index" TypeError: can''t convert Fixnum into String from
2007 Jun 02
2
Server-side Image Maps in Rails
I''ve been working on an idea to use a server-side image map to allow users to click anywhere in an area and have a new element appear at the location they clicked. Everything was going well, until it came time to connect the routing map. Here are the relevant parts: In the view, the map is created by -- <%= link_to(image_tag(''floor_plan.png'', :width =>
2006 Mar 10
0
WEBrick crashing
ruby 1.8.2 (2004-12-25) [i386-mswin32] latest version of edge rails - patched to make the server work with win32 (http://dev.rubyonrails.org/ticket/4139) On some pages WEBrick is crashing with the following: d:/programming/ruby/lib/ruby/1.8/profiler.rb:27: You have a nil object when you didn''t expect it! (NoMethodError) You might have expected an instance of Array. The error occured
2007 Sep 16
2
Problem with recognize_path
Hello, I am experiencing a weird problem on one of the 3 test servers I''m using: There is a controller named admin/statistics and I am trying to access /admin/statistics The matching rule is: map.connect '':controller/:action/:id'' On 2 of the 3 servers, recognize_path correctly matches to Parameters: {"action"=>"index",
2009 Nov 10
10
Un-recognised routes that do exist, using namespaces & subdomain checking
I''m getting really cheesed off with RSpec not matching some of my routes when controller testing when I have subdomain checking (courtesy of subdomain-fu) on namespaces. These routes appear in the rake routes output, and work fine via HTTP requests . The really annoying thing is it''s working fine for routes that aren''t at the root of the namespace. E.g. say I have
2006 Aug 09
0
recent changes in routes
I''m writing a plugin that automatically creates a named route buy hijacking RouteSet''s draw method. This no longer seems to work in edge rails. Anyone know what changes in routes effected this and what the preferred way would be now to automatically include route? Here''s the code that used to work: class ActionController::Routing::RouteSet alias_method
2006 Feb 08
2
Adding routes via a plugin...
I have a plugin that I am working on that will as part of its distribution contain a controller. I would like to be able to add a route for it in the plugin''s init.rb so that when the plugin is loaded, the route will automatically be registered without having to force the user to edit routes.rb or even make a rake task to do it for them. I saw the following code in one of the SVN
2006 Aug 03
1
routeset mapper problem
hello, I installed a rails app on dreamhost, which I''m building based on the Comatose plugin, and it went smoothly for the first version. Now I uploaded a second version where I broke down the Comatose code into a regular rails app, which works alright locally, but can''t get routing to work the same as before on the server. I believe I double-checked all gotchas mentioned
2006 Apr 23
1
Can''t override routing code
I want to change some of Rails'' routing code so that I can make routes subdomain-sensitive. The code at http://wiki.rubyonrails.com/rails/pages/RoutingSubdomains works fine when I edit the file (in my case, C:\Program\Ruby\lib\ruby\gems\1.8\gems\actionpack-1.12.1\lib\action_controller\routing.rb) directly. Changing that file seems very fragile, so I figured I would override the
2010 Dec 15
2
Error reverse engineering MySQL with RMRE
Hi I am been trying in vain to auto-gen models by reverse-engineering mysql using RMRE. It complains mysql2 gem missing but as seen in my Rails environment below, it is there. Here''s my Rails environment and RMRE error. Experts... please help! Thanks a ton in advance!! === Ruby version 1.9.2 (x86_64-linux) RubyGems version 1.3.7 Rack version 1.2 Rails version 3.0.3 Active Record
2007 Nov 16
3
Route Information
Is there a method to return a hash of the route configuration based on a path? For example: magic_method(''/my_controller/my_action/my_id'') => {:controller => ''my_controller'', :action => ''my_action'', :id => ''my_id''} Thanks! Tom --~--~---------~--~----~------------~-------~--~----~ You received this message
2006 Apr 03
3
[newbi] Problem Routes
Hello, i try to follow this video http://www.illanti.com/files/locomotive101.mov After change my routes routes.db ActionController::Routing::Routes.draw do |map| # Add your own custom routes here. # The priority is based upon order of creation: first created -> highest priority. # Here''s a sample route: # map.connect ''products/:id'', :controller =>
2007 Jan 24
0
problems with themes in rails 1.2.1 -> named_route
i saw someone mentioned this somewhere else (1), but i wanted to make sure that this wasn''t something that was going to cause me alot of grief later.. i have been using the theme plugin (2) on several projects.. i updated to 1.2.1 today, and upgraded my mongrel to the latest one.. when i try running mongrel after updating my project, i get the following error:
2009 May 01
4
Can't get to an action in a RESTful controller
Folks, I am using the restful_authentication plugin. This creates the users controller which is declared as a resource in routes.rb as below map.resources :users Now in the UsersController I have created an action to resetpwd that I am trying to get to from the login page when the user clicks "forgot password". However, when I do that the log file tells me that the call to
2007 Dec 28
1
Rake routes & console showing one thing, app doing another
OK, I have a routing problem, that seems to be working in the console, and with rake routes but not in the app. I have people that have nested tasks, like so: ------------------------------- # routes.rb map.resources :people do |person| person.resources :phone_notes person.resources :documents person.resources :tasks, :member => {:complete => :put} end map.resources :tasks, :member
2006 Jul 05
1
Routing error "unitialized constant" after refactoring
Hi. I''ve heavily refactored an application. When I access http://0.0.0.0:3000/ I now get the stack trace at the end of this mail. My routes.rb: ActionController::Routing::Routes.draw do |map| map.connect '''', :controller => ''user/dashboard'', :action => ''boo'' map.connect '':controller/:action/:id'',