Luca Scaljery
2008-Aug-20 15:28 UTC
activeresource: self.prefix = .../:id/... (need to set :id?)
Hi All As I mentioned in my title I''m using activeresource and the model I''m using has the following prefix self.prefix = ''/institute/:institute_id/services/:service_id/'' All this is great, however I''m now in a situation where I need to save the model, but it translate the prefix as follows /providers/983783784/services//appointments/234234234 So, the :service_id is unknown and is not part of the prefix. Here is the save command: @myModel.save(:params => {:a => {:service => %w(mylink)}, :user_id => current_user.id}) I''m not an activeresource expert so I''m not really sure whats going on here. Is :a something activeresource understands (or maybe a hack of the application) ? Furthermore, suppose I have the service_id in a variable (@service_id), how do I add this to this method ? I''ve tried things like: @myModel.save(:params => {:a => {:service => %w(mylink)}, :user_id => current_user.id, :service_id => 123}) but it didn''t fix it (I guess the stuff with the :a doesn''t work) Thnx a lot Luca ps: links to useful docs would be helpful too!! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---