similar to: RESTful Routes not working - Switches ID and Action

Displaying 20 results from an estimated 10000 matches similar to: "RESTful Routes not working - Switches ID and Action"

2008 Nov 16
0
non-RESTful action or nested routes?
I''m creating a simple task management system to learn Rails. I have a "task" which is part of a "project", as so: /projects/5/tasks for project with id 5''s tasks My task has a concept of being started, completed and updated. "Updating" maps to the existing RESTful routes provided by Rails. Started and completing, however, do not (at least not
2006 Oct 16
0
Restful routes, not repeating yourself and non-standard rest actions best practices
So I''ve recently started playing with the restful routes support in edge rails, converting a few of my controllers to support all the standard operations.. One thing that''s been bothering me, however, is the following: Before using restul routes, I would define an edit method in my controller which would be responsible for both creating new objects as well as editing
2008 Jan 21
2
multiple ids on restful action
Hi, I know this question has come up before, but I couldn''t find a satisfying answer. Maybe I didn''t look well enough, so any pointers to old messages regarding this subject would be welcome too. I need some way to pass multiple ids to a resource. Something like /posts/13,14 If I do this I have to manually split the id on ","s in the action, and use post_path([post1,
2009 Sep 24
4
Action Controller ::MethodNotAllowed
Hi, Iam getting the following error ActionController::MethodNotAllowed Only get, put and delete requests are allowed. Actually, Iam trying to have multiple actions for a form to create new record. The actions for the form are cancel, save, publish and preview. here''s the config/routes.rb file code snippet for the relevant controller - Events map.resources :events, :member =>
2006 Jan 25
1
Using image_tag in Action Mailer???
I''m trying to send a HTML formatted email with Action Mailer and everything works fine except for when I try to use a Rails image_tag in my email template. Does anyone have experience doing this? I keep getting this error |undefined method `request'' for #<SamplesDirectMailer:0x231d4d8>| Extracted source (around line *#7*): |7: <div style="position:absolute;
2007 Sep 04
2
specing helpers fails on restful routes
Hi, I am trying to spec helper methods in a Rails project, but it seems the specs fail with the error: You might have expected an instance of Array. The error occurred while evaluating nil.<< if the restful routes helper are used either in spec files, or the helper file. What can I be doing wrong? Or how can I fix this. Thanks! -- Surendra Singhi http://ssinghi.kreeti.com,
2007 Sep 22
1
Testing RESTful routes
Hi all, The app I am making right now uses restful routing entirely. I want to prevent people from accessing my actions without the proper HTTP verb so I commented out the :controller/:action/:id catch all routes that were used in pre-RESTful Rails apps. Like so: #map.connect '':controller/:action/:id.:format'' #map.connect '':controller/:action/:id''
2007 Mar 09
1
Specifying RESTful Routes
What would be the proper way to specify this route? ActionController::Routing::Routes.draw do |map| map.resource :recipes end Would the specification go into recipes_controller_spec? Also, what methods are available for testing RESTful routes (i.e. GET, POST, PUT, DELETE)?
2007 Oct 26
0
Composite Keys on RESTful Routes
I am building an app with existing controllers/actions, using traditional rails routes. I recently started moving over to RESTful routes and have hit a snag. Now I am reconsidering my whole effort and may go back to the original, more flexible, map.connect method. My problem is, one of the resources has composite keys. The keys are both strings as well, and can include dots. Here''s
2009 Mar 11
3
[rspec, rails] Restful Routes in controller specs
Hi, how is it possible that I can use the restful routes helpers (e.g. new_user_path) in controller specs? I browsed the source code but I couldn''t find the magic. I''m just curious and would appreciate any hint... thanks Andi
2008 Mar 24
2
link_to_remote and restful routes/urls
is there a way to access a restful resource with mike''s new link_to_remote helper? something like: <%= link_to_remote h(user.name), :update => "div_id", :url => user_url(user) %> of course, that doesn''t work. i have also been trying things like: :url => controller.asset_host +
2006 Aug 30
0
Rubyists of Second Life Meeting on RESTful Routes | 08/31/2006
The virtual user group Rubyists of Second Life will meet this Thursday, August 31, and next Thursday, September 7, at 6:00 pm PST. This Thursday, Theodore Polonsky will be presenting on simply_restful and the new RESTful routes in Rails Core, and Polypus Watts will be presenting on DRP: evolutionary/social programming for interactive/design tasks in Ruby. Second Life is a virtual 3D world and
2010 Aug 06
1
RESTful routes and verify :method
If my application is using RESTful routing, does using "verify :method" in controllers become redundant? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2007 Jan 16
2
RESTful routes and Mime::Type
Hi all I''m using RESTful routes combined with the to_csv plugin and would like to know if there''s a nicer way of generating a link to fetch the CSV file than just making a hard link. This is what I use for the moment (and it works btw): <%= link_to("Export as CSV","/companies.csv") -%> I would expect the link helper to have something like
2007 Jan 05
2
Using RESTful routes in controller tests
Why can''t I use the RESTful route helpers in my specs? In my controller I''m doing a redirect: redirect_to list_path(:id => @item.list_id) Now when I write: controller.should_redirect_to list_path(:id => 2) I''m getting the following error: NoMethodError in ''POST on /lists/2/items should redirect to index on succesful POST'' You have a nil object
2008 Oct 18
0
Link_to + PUT + restful routes problem
Hi, I''m trying to use link_to to access the Update action + add some extra parameters. I''m using the default rest routes. I can''t get it working. When I use: <%= link_to '' Accept'', invitation_path, :method => :put, :id => ''1'', :command => ''accept'' %> I can get into the Update action but the
2007 Jul 28
0
Nested RESTful Routes and creating a object from XML
I am trying to create a new model from XML that contains has a has_many relationship. Is this possible without having to write code to parse the XML or to doing multiple POSTS? I can do a post with XML that doesn''t contain any of the has_many elements and it works fine. It is when I add the items from the has_many relationship that I get a bunch of errors. Here are the examples I am
2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb: map.resources :product_categories it provides urls such as: /product_categories /product_categories/1 /product_categories/1;edit etc. and uses the ProductCategories controller. how can I keep the same controller (and model) but set up the resources so that I can have any abitrary url point to the existing controller, much like specifying the controller
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
2008 Aug 27
6
Restful routes
Hi, I''m pretty new to the concept of restful routing and am struggling to find any rails 2 info that helps with what I''m looking for. I have a regular scaffold setup and the routes are setup as default map.resources :pages I would like to be able to use titles in the url rather than relying on the id. Eg localhost:3000/pages/sometitle instead of just localhost:3000/pages/1