Forum: Ruby on Rails empty text_area yields 'Template is missing' error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dan K. (Guest)
on 2007-03-09 02:03

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

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.


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

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.
This topic is locked and can not be replied to.