I have t_project model and want to get "id" and "from_date" datas. how can I call them I didnt understand codes at all. I need to add the values to textbox ? could you pls check the model . Attachments: http://www.ruby-forum.com/attachment/1352/t_project.rb -- 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 -~----------~----~----~----~------~----~------~--~---
Ibrahim Dogru wrote:> I have t_project model and want to get "id" and "from_date" datas. how > can I call them I didnt understand codes at all. I need to add the > values to textbox ? could you pls check the model .Is "id" and "from_date" the fields in table t_projects? Do you want to insert data into this table or edit the current data? -- 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 -~----------~----~----~----~------~----~------~--~---
Suneeta Km wrote:> Ibrahim Dogru wrote: >> I have t_project model and want to get "id" and "from_date" datas. how >> can I call them I didnt understand codes at all. I need to add the >> values to textbox ? could you pls check the model . > > Is "id" and "from_date" the fields in table t_projects? Do you want to > insert data > into this table or edit the current data?"id" and "from_data" are the fields in the table. I want to insert data from fields to textbox in view. is it possible ? I got two textbox one is for id one is for from_date.. thanks for your reply... -- 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 -~----------~----~----~----~------~----~------~--~---
Ibrahim Dogru wrote:> Suneeta Km wrote: >> Ibrahim Dogru wrote: >>> I have t_project model and want to get "id" and "from_date" datas. how >>> can I call them I didnt understand codes at all. I need to add the >>> values to textbox ? could you pls check the model . >> >> Is "id" and "from_date" the fields in table t_projects? Do you want to >> insert data >> into this table or edit the current data? > > > "id" and "from_data" are the fields in the table. I want to insert data > from fields to textbox in view. is it possible ? I got two textbox one > is for id one is for from_date.. > > > thanks for your reply...It is possible... In the controller u first find the fields from the table and store it in an instance variable. @t_project= TProject.find(id) // id will be the id of the field u want to find then in the view: <%= text_field "t_project", "id" %> <%= text_field "t_project", "from_data" %> this will populate the text box with the value in the table -- 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 -~----------~----~----~----~------~----~------~--~---
> <%= text_field "t_project", "id" %> > <%= text_field "t_project", "from_data" %> > > this will populate the text box with the value in the tablethanks -- 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 -~----------~----~----~----~------~----~------~--~---