Hello Guys! Please i wish to know how can i change database column names dynamically at run time. Say i have a legacy database and some of the column names are not meaningful to the user. for example i have a column named "timeaccessioned" ; the user wants to see "recording date", so it makes sense to have to change that at run time particulary if am using a method like column.human_name to send the column data to the views. Any one who has encountered this and has an idea how to overide the database column names during runtime? Thanks -- 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 -~----------~----~----~----~------~----~------~--~---
1. Let go of scaffolding and it''s "one-size-fits-all" content_columns. Embrace getting a little dirty with ERb and Rails. 2. Simply alias the attributes in question. alias_attribute is your friend there! Actually you don''t have to do number one there but getting rid of those scaffolding training wheels is a good thing. You gain a lot more control over what you can do and how it looks. Hope that helps. RSL On 3/27/07, Tanzanite Tanzanite <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hello Guys! > > Please i wish to know how can i change database column names dynamically > at run time. > Say i have a legacy database and some of the column names are not > meaningful to the user. for example i have a column named > "timeaccessioned" ; the user wants to see "recording date", so it makes > sense to have to change that at run time particulary if am using a > method like column.human_name to send the column data to the views. > Any one who has encountered this and has an idea how to overide the > database column names during runtime? > > Thanks > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Russell Norris wrote:> 1. Let go of scaffolding and it''s "one-size-fits-all" content_columns. > Embrace getting a little dirty with ERb and Rails. > 2. Simply alias the attributes in question. alias_attribute is your > friend > there! > > Actually you don''t have to do number one there but getting rid of those > scaffolding training wheels is a good thing. You gain a lot more control > over what you can do and how it looks. Hope that helps. > > RSLThanks Russell for pointing the way. Actually am letting go scaffolding and wants to roll in mud with ERb and rails! -- 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 -~----------~----~----~----~------~----~------~--~---
It''s a bit harder than scaffolding but the payoffs are totally worth any effort you spend. Rails/Ruby is like a gift that keeps on giving. RSL On 3/27/07, Tanzanite Tanzanite <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Russell Norris wrote: > > 1. Let go of scaffolding and it''s "one-size-fits-all" content_columns. > > Embrace getting a little dirty with ERb and Rails. > > 2. Simply alias the attributes in question. alias_attribute is your > > friend > > there! > > > > Actually you don''t have to do number one there but getting rid of those > > scaffolding training wheels is a good thing. You gain a lot more control > > over what you can do and how it looks. Hope that helps. > > > > RSL > > > Thanks Russell for pointing the way. Actually am letting go scaffolding > and wants to roll in mud with ERb and rails! > > > -- > 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 -~----------~----~----~----~------~----~------~--~---