Displaying 20 results from an estimated 11000 matches similar to: "Status of Rails.application.routes.recognize_path()"
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
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
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
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
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
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",
2006 Mar 26
4
edge and 1.8.2/1.8.4 issues
I recently upgraded to 1.8.4 to try out mongrel, and so far have been in
a kind of hell where I can''t get my app working!
Currently running (or trying to run):
Ruby version 1.8.4 (i386-mswin32)
RubyGems version 0.8.11
Rails version 1.0.0
Active Record version 1.13.2
Action Pack version 1.11.2
Action Web Service version 1.0.0
Action Mailer version 1.1.5
Active Support version
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
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 Oct 03
3
manually invoking routing?
Hey folks. I have a rails controller which is filtering search results
for access control. The search results are typically URLs into the rest
of the rails app. I''m finding it would simplify the grotty code which is
accumulating if I could manually invoke the router. That is to say, if I
could send something a URI path string and get back the hash of
controller, action, and params that
2007 Aug 25
4
REST routes :has_many , new style
I am trying to write a nested route ''new style''
map.resources :franchises, :has_many => :documents
in place of the :
map.resources :franchises do |franchises|
franchises.resources :documents, :name_prefix => "franchise_"
end
but get an error :
no route found to match "/franchises/1/documents" with {:method=>:get}
running rake routes,
2007 Jan 17
8
Mocha Mock''s hanging on after test run?
Hi guys,
I''m running mocha (0.3.2) against Rails core and just found an issue
where the mock doesn''t go away after the test is run.
For example:
def test_reset_bang_doesn_reinstall_named_routes
ActionController::Routing::Routes.named_routes.expects(:install).never
@session.reset!
end
def test_zzz
puts ActionController::Routing::Routes.named_routes.inspect
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
2009 Aug 13
6
Strange Routing
Hi Guys,
I have some strangeness with routing, using standard route
map.connect '':controller/:action/:id''
map.connect '':controller/:action/:id.:format''
Using console I did
>> rts = ActionController::Routing::Routes
>> rts.generate(:action => "edit", :controller => ''vendorlocations'', :id => 10)
=>
2006 Jul 20
5
Why don''t I get 404s?
When I go to a missing page in my rails app, I get the 500.html page,
and this in my log output:
no route found to match "/asdasd" with {:method=>:get}
./script/../config/../vendor/rails/actionpack/lib/action_controller/
routing.rb:1057:in `recognize_path''
./script/../config/../vendor/rails/actionpack/lib/action_controller/
routing.rb:1047:in `recognize''
2006 Feb 13
1
dynamically generating a controller and appropriate routing
I''m working on a library similar to acts_as_taggable. I''d like it to be a
simple, one file drop-in: i.e., put my_library.rb into RAILSROOT/lib/ and
have everything work. However, the library requires a controller to render
some stuff, so I need to be able to create the controller class, set the
routing, and extend the controller at run-time from within my_library.rb.
I have code
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 =>
2007 Jun 15
4
404 Error in any controller/action on Media Temple
Hi everybody.
I''m a newbie on RoR. I have some experiencie developing in PHP or Java,
but I''m just starting with RoR.
A few days ago I signed up to the (gs) Grid Service on Media Temple.
This is my very first experience deplying RoR on a production
enviroment. Until now I just used the WebRick server on developement.
Well, the problem I''m having is that after
2007 May 21
4
Spec''ing redirect with arbitrary parameters
I''ve got the following expectation:
response.should redirect_to(:action => "new", :video_id => "1",
:process_id => "2", :origin_id => "3")
that fails with this error message:
expected redirect to {:video_id=>"1", :process_id=>"2",
:origin_id=>"3", :action=>"new"}, got redirect to
2007 Jun 27
1
Active Scaffold controllers created dynamically at runtime?
Does anyone know how to link Rails'' routes into anonymous controller
classes created at runtime (defined with their superclass as
ActionController::Base)?
I''m trying to create a plugin for all of my projects that dynamically
creates an active_scaffold controller for each model. It would
essentially be like a scaffold_all_models for active_scaffold. I believe
the original