I''ve used composite_primary_keys to define a legacy table in my application - class AircraftHistory < ActiveRecord::Base def self.table_name() "t1010aircraft_history" end set_primary_keys :aircraft_id, :aircraft_sequence belongs_to :aircraft end I''ve generated the controller and views using - script/generate scaffold aircraft_history The "list" functionality works fine, but when I click on "show" or "edit" I get the error message - no route found to match "/aircraft_history/show/35707,4" with {:method=>:get} The "35704,4" are the values for "aircraft_id,aircraft_sequence" How to I make it able to use the combined value. I see an explanation on the web page about using to_s or to_param, but I''m not sure exactly how. Thanks Phil --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
In your routes.rb file, you should put the following: map.connect '':controller/:action/:aircraft_id,:aircraft_sequence'' I''m fairly certain that will work (I''m moderately newbie-ish) On 2/23/07, Philip Nelson <teamdba-RvFq4O/J5Z7QT0dZR+AlfA@public.gmane.org> wrote:> > > I''ve used composite_primary_keys to define a legacy table in my > application - > > class AircraftHistory < ActiveRecord::Base > def self.table_name() "t1010aircraft_history" end > > set_primary_keys :aircraft_id, :aircraft_sequence > > belongs_to :aircraft > end > > I''ve generated the controller and views using - > > script/generate scaffold aircraft_history > > The "list" functionality works fine, but when I click on "show" or "edit" > I > get the error message - > > no route found to match "/aircraft_history/show/35707,4" with > {:method=>:get} > > The "35704,4" are the values for "aircraft_id,aircraft_sequence" > > How to I make it able to use the combined value. I see an explanation on > the > web page about using to_s or to_param, but I''m not sure exactly how. > > Thanks > > Phil > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Luke, Thanks for the tip. � I will give it a try. I had thought that I could pass the multiple parameters into the controller as a single parameter, but was obviously looking in the wrong place. Phil On Friday 23 February 2007 21:36, Luke Ivers wrote:> In your routes.rb file, you should put the following: > map.connect '':controller/:action/:aircraft_id,:aircraft_sequence'' > > I''m fairly certain that will work (I''m moderately newbie-ish) > > On 2/23/07, Philip Nelson <teamdba-RvFq4O/J5Z7QT0dZR+AlfA@public.gmane.org> wrote: > > I''ve used composite_primary_keys to define a legacy table in my > > application - > > > > class AircraftHistory < ActiveRecord::Base > > def self.table_name() "t1010aircraft_history" end > > > > set_primary_keys :aircraft_id, :aircraft_sequence > > > > belongs_to :aircraft > > end > > > > I''ve generated the controller and views using - > > > > script/generate scaffold aircraft_history > > > > The "list" functionality works fine, but when I click on "show" or "edit" > > I > > get the error message - > > > > no route found to match "/aircraft_history/show/35707,4" with > > {:method=>:get} > > > > The "35704,4" are the values for "aircraft_id,aircraft_sequence" > > > > How to I make it able to use the combined value. I see an explanation on > > the > > web page about using to_s or to_param, but I''m not sure exactly how. > > > > Thanks > > > > Phil > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---