Simple text_area problem

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

test

<%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"})%>


<%=submit_tag(‘Apply Template’, :name=>“submit”)%> &nbsp&nbsp&nbsp&nbsp
<%=link_to (“Create
Template”,{:controller=>“template”,:action=>“create_template”})%>
&nbsp&nbsp&nbsp&nbsp
<%=link_to(“Update
Template”,{:controller=>“template”,:action=>“update_template”,:id=>t.id})%>
&nbsp&nbsp&nbsp&nbsp
<%=link_to(“Update
Template”,{:controller=>“template”,:action=>“delete_template”,:id=>t.id})%>

<%=t.text_area(“template_text”,:name=>“textarea”,:cols=>50,:rows=>600)%>
<%end%>

Please help.

Thank you.

<%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"})%>


<%=submit_tag(‘Apply Template’, :name=>“submit”)%> &nbsp&nbsp&nbsp&nbsp
<%=link_to (“Create
Template”,{:controller=>“template”,:action=>“create_template”})%>
&nbsp&nbsp&nbsp&nbsp
<%=link_to(“Update
Template”,{:controller=>“template”,:action=>“update_template”,:id=>t.id})%>
&nbsp&nbsp&nbsp&nbsp
<%=link_to(“Update
Template”,{:controller=>“template”,:action=>“delete_template”,:id=>t.id})%>

<%=t.text_area(“template_text”,:name=>“textarea”,:cols=>50,:rows=>600)%>
<%end%>

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs