joe
2008-Feb-29 12:36 UTC
cn w update d two tables under one .. action.....both tables r in one to one relation
i hav tried this thng.....but it s coming to the else part.
class Article < ActiveRecord::Base
belongs_to :category
end
class Category < ActiveRecord::Base
has_one :article
end
def update
@article = Category.new
@article.uploaded_data = (params[:article])
@article.article = Article.find(params[:id])
@article.article.tag_list = (params[:tag_list])
if @article.update_attributes(params[:article])
redirect_to :action => ''show'', :id => @article
else
@categories = Category.find(:all)
render :action => ''edit''
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---
Mislav Marohnić
2008-Feb-29 13:51 UTC
Re: cn w update d two tables under one .. action.....both tables r in one to one relation
On Fri, Feb 29, 2008 at 1:36 PM, joe <joe.nayyar@gmail.com> wrote:> > i hav tried this thng.....but it s coming to the else part.Joe, you have posted to the wrong group. These questions belong here: http://groups.google.com/group/rubyonrails-talk or on the Rails forum: http://railsforum.com/ And while you are asking your questions there, please try and write full words and sentences in English language so that people can understand your questions and answer them. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
joe
2008-Mar-01 05:45 UTC
Re: cn w update d two tables under one .. action.....both tables r in one to one relation
okk......mislavv... On Feb 29, 6:51 pm, "Mislav Marohnić" <mislav.maroh...@gmail.com> wrote:> On Fri, Feb 29, 2008 at 1:36 PM, joe <joe.nay...@gmail.com> wrote: > > > i hav tried this thng.....but it s coming to the else part. > > Joe, you have posted to the wrong group. These questions belong here:http://groups.google.com/group/rubyonrails-talk > or on the Rails forum:http://railsforum.com/ > > And while you are asking your questions there, please try and write full > words and sentences in English language so that people can understand your > questions and answer them. Thanks.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---