Displaying 20 results from an estimated 22 matches for "routeset".
Did you mean:
route_set
2006 Aug 03
1
routeset mapper problem
...found.
here''s the routing config I have
in /config/routes.rb I have:
map.content_root ''''
and then there are two route_mappers, required from environment.rb,
which are loaded depending on the version of rails
in environment.rb:
if defined? ActionController::Routing::RouteSet::Mapper
require ''support/route_mapper''
else
require ''support/routes''
end
in /lib/support/routes.rb:
# Adds the content_root mapping support to the Rails Routset
class ActionController::Routing::RouteSet
def content_root( path, options={} )
opts = {...
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
2011 Jun 22
3
Status of Rails.application.routes.recognize_path()
...cognize_path(). Beautiful. It
works great.
However, when trying to re-learn or re-discover this method (I hadn''t used
it in quite a while) I noticed it isn''t documented (
http://api.rubyonrails.org/). Rails.application.routes returns an instance
of the ActionDispatch::Routing::RouteSet class which, looking at the source,
has the "#:nodoc:" rdoc tag to prevent it being included in the project
documentation.
This communicates to me that this isn''t considered part of the public API
and is therefor subject to change, be renamed, whatever.
So my question is, is...
2006 Apr 23
1
Can''t override routing code
...directly.
Changing that file seems very fragile, so I figured I would override the
method in question in environment.rb instead. However, it seems my
routing code is never used for routing...
I added this to the end of environment.rb and rebooted the server:
class ActionController::Routing::RouteSet
def recognize(request)
"some text for testing"
end
end
Now, if I do this in some view, I get the output "some text for
testing":
DEBUG: <%=ActionController::Routing::RouteSet.new.recognize(:foo)%>
but the new RouteSet#recognize method is obviously not bei...
2007 Jan 17
8
Mocha Mock''s hanging on after test run?
...outing::Routes.named_routes.expects(:install).never
@session.reset!
end
def test_zzz
puts ActionController::Routing::Routes.named_routes.inspect
assert !ActionController::Routing::Routes.named_routes
end
The print when test_zzz is run gives this:
#<ActionController::Routing::RouteSet::NamedRouteCollection:0x14e0da8
@mocha=#<Mocha::Mock:0x2333504 @__mock_name=nil,
@expectations=[#<Mocha::Expectation:0x2333158 @count=0,
@parameter_block=nil,
@backtrace=["test/controller/integration_test.rb:146:in
`test_reset_bang_doesn_reinstall_named_routes''",
"/usr...
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 :_...
2007 Jan 24
0
problems with themes in rails 1.2.1 -> named_route
...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:
/Users/xxxx/Sites/theres_this_place/config/../vendor/plugins/theme_support/lib/patches/routeset_ex.rb:26:in
`create_theme_routes'': undefined method `named_route'' for
#<ActionController::Routing::RouteSet:0x14d5c18> (NoMethodError)
which is actually alot longer (3)..
is there something i need to to to get named_route working?
the fix mentioned in (2) does work, but i...
2009 Nov 10
10
Un-recognised routes that do exist, using namespaces & subdomain checking
...that doesn''t make a blind bit of difference.
Maybe RSpec is doing something different with the request, as if I
monkey patch the routing with the following I never get the dumps when
using RSpec even though both these are called pretty early on in route
recognition.
module Foo
module RouteSetExtensions
def self.included(base)
base.alias_method_chain :extract_request_environment, :debug
base.alias_method_chain :recognize_path, :debug
end
def recognize_path_with_debug(path, environment={})
puts path
puts environment.to_yaml
recognize_path_without...
2006 Feb 08
2
Adding routes via a plugin...
...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 rails/plugin modules:
ActionController::Routing::RouteSet.send :include, RestfulRoutes
, but it just includes a module with a method to add named routes.
I would like to actually add a route to the routeset automatically. I tried
using variations on the above to directly call named_route from my plugin''s
init.rb, but I have not been able to ge...
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
2006 Mar 10
0
WEBrick crashing
...0.00 0.00 Thread#new
0.00 6.55 0.00 1 0.00 0.00
Dependencies.depend_on
0.00 6.55 0.00 2 0.00 0.00
CGI::Session::ActiveRecord
Store::Session#reloadable?
0.00 6.55 0.00 1 0.00 0.00
ActionController::Routing:
:RouteSet#recognize!
0.00 6.55 0.00 1 0.00 0.00 Object#require
0.00 6.55 0.00 1 0.00 0.00 Array#select
0.00 6.55 0.00 3 0.00 0.00 String#empty?
0.00 6.55 0.00 3 0.00 0.00 Kernel.==
0.00 6.55...
2007 Mar 06
4
Rails 1.2 / Theme support plugin issue: Fix
This is to answer one of my old issues, that I was having using Theme
support plugin using with Rails 1.2.
When you get an latest edge Rails update and run your application which
has Theme support plugin you will get following error
/script/../config/../vendor/plugins/theme_support/lib/patches/routeset_ex.rb:26:in
`create_theme_routes'': undefined method `named_route'' for
#<ActionController::Routing::RouteSet:0x1313b78> (NoMethodError)
from
./script/../config/../vendor/plugins/theme_support/lib/patches/routeset_ex.rb:13:in
`draw''
from ./script/../config/../config...
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
2011 Jan 10
0
Can't use ActionDispatch::Request in Rails middleware because path_parameters get lost
...@env["action_dispatch.request.path_parameters"] = parameters
end
You can also see the Router Dispatcher directly grabbing the
path_parameters from the environment instead of going to through the
request object.
#file: action_dispatch/routing/route_set.rb
class RouteSet
PARAMETERS_KEY = ''action_dispatch.request.path_parameters''
class Dispatcher #:nodoc:
def initialize(options={})
@defaults = options[:defaults]
@glob_param = options.delete(:glob)
@controllers = {}
end
def call(env...
2011 Jun 21
0
Status of Rails.application.routes.recognize_path()
...cognize_path(). Beautiful. It
works great.
However, when trying to re-learn or re-discover this method (I hadn''t used
it in quite a while) I noticed it isn''t documented (
http://api.rubyonrails.org/). Rails.application.routes returns an instance
of the ActionDispatch::Routing::RouteSet class which, looking at the source,
has the "#:nodoc:" rdoc tag to prevent it being included in the project
documentation.
This communicates to me that this isn''t considered part of the public API
and is therefor subject to change, be renamed, whatever.
So my question is, is...
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
2007 Jun 02
2
Server-side Image Maps in Rails
...in the routes.rb file we have (at the top of the list)
--
map.connect '':controller/:action?:x,:y''
Now, if I drop into the console, load up the routing map, and evaluate,
this is what I get --
>> rs = ActionController::Routing::Routes
=> #<ActionController::Routing::RouteSet:0x197da14
@routes_by_controller=nil, ...>>
>> rs.recognize_path ''/report/generate_ticket?10,20''
=> {:action=>"generate_ticket", :controller=>"report", :y=>"20",
:x=>"10"}
However, when I click on the image map, th...
2006 May 07
3
Needle + Rails - IoC
...wire the controllers at request time, so
that they be injected with services from the Needle registry. Being new
to Rails I have the background thought that I could do this with a
plugin? I think that I probably need to wire up the controller during
the execution of the recognize method in the RouteSet class.
All thoughts welcome, especially past experiences about the same effort.
Cheers,
Nick
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 Mar 03
5
url_for and arrays parameters (diffs between rails 1.1.6 and 1.2.2)
Hello,
I posted this to the main rails list
(http://www.ruby-forum.com/topic/99845), but haven''t received any
replies yet, so maybe this question is better suited here. Sorry if
this has been brought up before, I couldn''t find any previous
discussion on this.
To summarize the post...
When using the latest Rails (1.2.2)
I''m passing an array to url_for like so...