Displaying 17 results from an estimated 17 matches for "named_route".
2006 Aug 03
1
routeset mapper problem
...Set
def content_root( path, options={} )
opts = {
:index => '''',
:layout => ''content'',
:use_cache => ''true'',
:cache_path => nil,
:force_utf8 => Comatose::Options.force_utf8.to_s,
:named_route=> nil
}.merge(options)
# Ensure the controller is aware of the mount point...
ContentController.add_root(path, opts[:index])
# Add the route...
opts[:controller] = ''content''
opts[:action] =''show''
route_name = opts.delete(:named_rout...
2007 Jan 24
0
problems with themes in rails 1.2.1 -> named_route
...o 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 wanted to see if there was a
more permanent solution yet..
thanks all!...
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
assert !ActionController::Routing::Routes.named_routes
end
The print when test_zzz is run gives this:
#<Ac...
2007 Mar 06
4
Rails 1.2 / Theme support plugin issue: Fix
...e
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/routes.rb:1
Fix that I found for this is
# Go to vendor/plugins/theme_...
2006 May 09
1
name_url in tests
...aste''):
test_routes(FilmsControllerTest):
NoMethodError: You have a nil object when you didn''t expect it!
The error occured while evaluating nil.rewrite
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:461:in `url_for''
generated/routing/named_routes/taste.rb:2:in `taste_url''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:431:in `send''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:431:in `method_missing''
test/functional/films_contr...
2007 Sep 04
7
1.05 to 1.08
Hi
We are looking at moving a project over from 1.05 to 1.08 but have a
problem with some of our helper specs
They work fine in 1.05 but error in 1.08 and it is the calls to route
helper methods that seems to be the problem.
I did some playing around .. because the code being tested is
reasonably large etc ... but this sample (using the peepcode app)
seems to boil down the problem
2012 May 11
14
What is the point of using :format in routes?
...''fields#show'', as: :field,
constraints: {id: /\d+/}
post ''/fields/remove/:id'' => ''fields#remove'', as: :remove_field
routes.js.coffee.erb:
<% h = Rails.application.routes.url_helpers
{ fields: false, remove_field: true }.each do |named_route, expect_id| %>
<% if expect_id %>
window.<%= named_route %>_path = (id, format=''.json'')-> "<%= h.send
:"#{named_route}_path", ''999'' %>#{format}".replace(''999'', id)
<% else %>
window.&l...
2006 Aug 09
0
recent changes in routes
...outeSet
alias_method :__draw, :draw
def draw
old_routes = @routes
@routes = []
begin
create_rcss_routes
yield self
rescue
@routes = old_routes
raise
end
write_generation
write_recognition
end
def create_rcss_routes
named_route ''plugin'', "/
controller/:plugin", :controller=>''controller'', :action=>''plugin''
end
end
2006 Jul 31
0
problems testing helpers - link_to and url_for don''t work...
So I''ve used the helper test plugin, and also tried some things from
Rails Recipes, and basically neither seems to work for cases where a
helper does anything related to link_to/url_for, and this includes
calling named_routes. This is obviously an issue, as a common use for
helpers is to refactoring something like this:
<%= link_to "text that changes slightly", :id => id %>
to this
<%= article_link "text", id, other_options %>
using a helper. That example is a over simplified, b...
2006 May 08
0
testing named routes
...s me:
2) Error:
test_routes(FilmsControllerTest):
NoMethodError: You have a nil object when you didn''t expect it!
The error occured while evaluating nil.rewrite
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:459:in `url_for''
generated/routing/named_routes/overviews.rb:2:in `overviews_url''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/test_process.rb:431:in `send''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/test_process.rb:431:in `method_missing''
functional/films_co...
2006 Sep 26
0
some help with functional testing of nested routes
...=> ''index''
assert_equal num_records + 1, Product.count
end
.
.
.
I have the following in my routes file:
map.resources :categories, :classifications
map.resources :categories do |m|
m.resources :products
end
Using the routes navigator i have the following:
named_route > products
[:category_id, :action, :controller]
{:action=>"index", :controller=>"products"} {:method=>:get}
/categories/:category_id/products/
product
[:category_id, :id, :action, :controller]
{:action=>"show", :controller=>"products"}...
2012 Sep 04
0
dynamic route generation
...sers_path) gets invoked on self (assuming there was not
RoutesProxy instance appended as the first element of the array passed
as the first argument to form_for, then send() would be invoked on
self, which is PolymorphicRoutes module, which belongs to
ActionDispatch::Routing):
(proxy || self).send(named_route, *args)
so where exactly is post_users_path, for example, defined (and its
obvious that it must being defined dynamically using instance_eval or
class_eval based on the resource generation of routes).
but I would like to know where in the latest release of Rails source
on github is that definitio...
2008 Jul 23
0
undefined method `first' for :users:Symbol
...vendor/rails/actionpack/lib/
action_controller/routing.rb:616:in `new''
from ./script/../config/../vendor/rails/actionpack/lib/
action_controller/routing.rb:616:in `connect''
from ./script/../config/../vendor/rails/actionpack/lib/
action_controller/routing.rb:645:in `named_route''
from ./script/../config/../vendor/rails/actionpack/lib/
action_controller/routing.rb:651:in `method_missing''
from ./script/../config/../config/routes.rb:3
from ./script/../config/../vendor/rails/actionpack/lib/
action_controller/routing.rb:625:in `draw'...
2006 Feb 08
2
Adding routes via a plugin...
...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 get it to work.
Also I notice that there is a reload method in the routing.rb file that will
clear out the current named routes and read in the routes.rb file again.
Does this get called internally somewhere by Rails? I guess I am won...
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
2011 Jan 19
6
rake aborted! can't convert Hash into String
Hello,
I encouter a problem when i try to do "rake db:migrate":
rake aborted!
can''t convert Hash into String
Here is the trace result:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
can''t convert Hash into String
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1408:in
2006 Aug 10
28
On the total nondisclosure of the 8/9/06 security vulnerability
Dear Rails team,
The handling of the recent vulnerability in Rails has proven somewhat
problematic for us. We have recently adopted Rails as our web platform
of choice; previously, we used J2EE. We love Rails. We hate J2EE. We
don''t want to go back. It took a lot of effort and convincing to get the
management teams of our various projects to sign off on the use of
Rails. The