"my problem basically is how to put the data in the content table(with forms initially intended for the "owner" tables)"
with AR saves automatically to child associations accepts_nested_attributes_for :content and that way you have a form for the parent and it will also save the associated child on the fly. http://railscasts.com/episodes/196-nested-model-form-part-1 http://railscasts.com/episodes/196-nested-model-form-part-2 On Sun, Sep 12, 2010 at 5:15 PM, Almog Friedman <[email protected]> wrote: > thats all nice and well but my problem basically is how to put the data in > the content table(with forms initially intended for the "owner" tables) > > the function i mentioned in the link is the function that deals with that > problem. the only problem is that i don't have the "right" place to put it. > the best place i could think of is in a class that inherits ActiveRecord > and that all the models inherit it. > > is there a better place? > > On Sun, Sep 12, 2010 at 9:04 PM, radhames brito <[email protected]> wrote: > >> you said you wanted to add more laguages with time, mongodb lets you at >> columns to a table on the fly, like this, >> >> lets say you have a table called Content with a column for each language >> but right now you have 2 languages, english and italian >> with mongodb you just say , content.german = "...", with mongodb and from >> then on the table has a german field no migrations needed. >> >> >> at this are the columns >> >> content >> id| owner_type| owner_id | english| italian | >> >> then one day you say >> >> >> article.content.german = "blah blah" >> >> then on the fly from that day on the table turn to this without the need >> for migrations >> >> content >> id| owner_type| owner_id | english| italian | german| >> >> >> >> On Sun, Sep 12, 2010 at 2:42 PM, Almog Friedman <[email protected]> wrote: >> >>> the problem with that way is that it is intended for an application which >>> receives most of its data as user content and the static content of the >>> page(what i control of) is by the most parts isn't much. most of it is >>> titles and headlines and maybe some explanations of things. >>> >>> this is not the case with my app. >>> with my app i am the provider of most of the data, the user only >>> interacts with it. im talking about hundreds upon hundreds of lines of >>> content all made by me. i don't want to edit this entire data by hand, >>> i want to use a database. which is why i got to my method as described in >>> my vary first post. with a simple form with which i could insert the data to >>> the database at ease. >>> >>> now as i ran out of options, could you please help me figure out where >>> should i put this method i did so i would still follow the DRY principle and >>> use MVC correctly? >>> >>> >>> On Sun, Sep 12, 2010 at 3:54 PM, Alpha Blue <[email protected]>wrote: >>> >>>> Almog Friedman wrote: >>>> > first of all >>>> > Alpha blue, thats exactly what i want.any ideas on how to do this? >>>> > and radhames brito, i didnt understand a thing from your comment. >>>> could >>>> > you >>>> > explain a little more what do you think i need to do? >>>> >>>> You might want to start here: >>>> >>>> http://github.com/defunkt/gibberish >>>> -- >>>> 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 [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]<rubyonrails-talk%[email protected]> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>>> >>> -- >>> 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 [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<rubyonrails-talk%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> -- >> 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 [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<rubyonrails-talk%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<rubyonrails-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

