search for: polymorphic_url

Displaying 7 results from an estimated 7 matches for "polymorphic_url".

2009 Jul 13
3
undefined method error from atom builder
...her HTML or Atom. The HTML response works fine, but the Atom Builder is blowing up with an undefined method error that I can''t figure out. It seems to be failing when the ActiveRecord instance is passed to the ''entry'' method and it tries to build the URL via the ''polymorphic_url'' method. There is no ''order_url'' method, field or database column, so I''m at a loss. Error message - undefined method `order_url'' for #<ActionView::Base: 0x25e3560> Code snippet that''s failing (line 7) - 4: 5: for order in @orders 6: 7:...
2008 Jan 21
8
Polymorphic URL helpers documentation and fixes
...ea in the past. http://dev.rubyonrails.org/ticket/10883 Check the documentation, please yell if anything is wrong: http://dev.rubyonrails.org/attachment/ticket/10883/PolymorphicRoutes.html?format=raw What''s still broken? (I decided not to fix everything in one go.) 1. Hash argument: polymorphic_url(:id => @article). Test is commented out (like before). 2. Should this work: polymorphic_url(@article, :format => :pdf) ? Currently it doesn''t. I''ve included a failing tests, it''s commented out. Open ActionPack tickets with "polymorphic" in title:...
2007 May 02
4
Shared Nested Resources
The skinny is that I''m attempting to add "Discussions" as resources under different resources ("Groups", "Projects", for example) and I''ve simply hit a roadblock (or two). Discussions are an association between the "discussable" (Group, Project, etc.) and a "Topic" so: class Discussion < ActiveRecord::Base belongs_to :topic
2012 Aug 07
9
How do I force link_to/form helpers to use the superclass name in the path instead subclass?
I want my helpers to generate paths using a superclass instead of the subclasses. Assuming I have Owner and Member that both inherit from User, rails will use the current objects class name when generating paths: Let''s say current_user is a mod: <%= link_to current_user.name, current_user %> will generate "/mod/:id". I want to force it to generate
2008 Dec 20
3
undefined method `stories_path'
...d. heres the traceback: /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/polymorphic_routes.rb:112:in `__send__'' /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/polymorphic_routes.rb:112:in `polymorphic_url'' /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/polymorphic_routes.rb:119:in `polymorphic_path'' /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/form_helper.rb:269:in `apply_form_...
2010 Nov 01
2
Creating RESTful helpers on the fly
If I have a resource called ''assets'' then I get for free a bunch of helpers, like assets_path new_asset_path and so forth, right? I would like to be able to create a call to one of these on the fly when I only find out the name of the resource at run time. For example I would like to do this: resource_name = "assets" resource_path(resource_name, method => :new)
2010 Jul 27
13
3.0.0rc ActionController::RoutingError No route matches
Have been developing on 3.0.0beta4 and just updated to 3.0.0.rc. When I try to link_to() a User object that previously had worked, I get the following: ActionView::Template::Error (No route matches {:action=>"destroy", :controller=>"games", :id=>#<User ..... > Yet I have in my routes.rb file has resources :users and my "rake routes" shows: