empty text_area yields ''Template is missing'' error

Dan Kelley
Fri, 09 Mar 2007 00:03:38 -0000

PROBLEM STATEMENT

My app gives a missing-template error if the user enters nothing into a
provided text_area.  But if something is provided, everything works
fine.

I''m still a newbie, so I don''t really understand the automatic
connection between things.  Is it a problem that I have
"views/thingee/new.rhtml"  and a "create" method in
"controllers/thingee_controller.rb", where . stands for my thingee.
I''m
guessing not, since it''s OK if I give content to the text_area.  But
maybe I''m still supposed to follow a convention, and the problem only
crops up with empty content ...???

You can tell by the fact that I write "thingee" that I don''t
really know
what words to use for things, and I''ve not discovered a standard
convention by scanning these forum postings.


APPLICATION SETUP


1. In views/thingees/new.rhtml

<% form_for :foo, :url => {:action => ''create''} do
|form| %>
  <%= form.text_area :content, :cols => 60, :rows => 4 %>
  <%= text_field_with_auto_complete :tag, :content, { :size => 60},
{:skip_style => false, :tokens => ['' '',
'','', '';'']} %>
  <%= submit_tag "Submit" %>
<% end %>

2. In app/controllers/thingees_controller

  def create
    ...
    if @rabbit.save
      (NEVER GETS HERE)
    ...

3. In app/db/migrate/001_create_thingees.rb

   ...
   t.column :content, :text, :default => ""
   # NB. I''ve also tried no default, and a nil default.

--
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
-~----------~----~----~----~------~----~------~--~---