Hello,
I have a table called templates and have three columns in it
id of type int
template_name of type varchar
template_text of type text
I am getting the following error
undefined method `template_text'' for
#<#<Class:0x45ad828>:0x45ad800>
have been trying to figure out for a while now. looksa very very easy
problem..
Also if i want to load value in the text_area when a template is
selected from the select field what should i write in the :value of the
text_area
<html>
<head>
<title>test</title>
</head>
<body>
<%form_for
:template,@template,:url=>{:controller=>"template",:action=>"submit_tag"}
do |t|%>
<%=t.select(:id,Template.find(:all).collect{|tem|[tem.template_name,tem.id]},{:prompt=>"-Select
a template"})%>
<br>
<%=submit_tag(''Apply Template'',
:name=>"submit")%>     
<%=link_to ("Create
Template",{:controller=>"template",:action=>"create_template"})%>
    
<%=link_to("Update
Template",{:controller=>"template",:action=>"update_template",:id=>t.id})%>
    
<%=link_to("Update
Template",{:controller=>"template",:action=>"delete_template",:id=>t.id})%>
<%=t.text_area("template_text",:name=>"textarea",:cols=>50,:rows=>600)%>
<%end%>
</body>
</html>
Please help.
Thank you.
--
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
-~----------~----~----~----~------~----~------~--~---
> > <%form_for > :template,@template,:url=>{:controller=>"template",:action=>"submit_tag"} > do |t|%> > <%=t.select(:id,Template.find(:all).collect{|tem|[tem.template_name,tem.id]},{:prompt=>"-Select > a template"})%> > <br> > <%=submit_tag(''Apply Template'', :name=>"submit")%>      > <%=link_to ("Create > Template",{:controller=>"template",:action=>"create_template"})%> >      > <%=link_to("Update > Template",{:controller=>"template",:action=>"update_template",:id=>t.id})%> >      > <%=link_to("Update > Template",{:controller=>"template",:action=>"delete_template",:id=>t.id})%> > > <%=t.text_area("template_text",:name=>"textarea",:cols=>50,:rows=>600)%> > <%end%> > </body> > </html> > > > > Please help. > > Thank you.Hi, Ok Got the solution..... Took me some time....I had named the table as templates and controller and model as template. I just renamed the table to mailtemplates, controller and model to mailtemplate and it works now. -- 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 -~----------~----~----~----~------~----~------~--~---