I left RoR few months ago and I’ve never used it very much, so I’ve a
small problem in the development of my application.
Db (mysql). Table: learned_things
The form:
<%= form_tag :action=>“add”, :method=>“post” %>
Text <%= text_field (“learnedthing”, “content”, “maxlength”=>250,
“size”=>60 ) %>
<%= submit_tag “Add” %>
<%= end_form_tag %>
‘Add’ action:
def add
if request.post?
elem = LearnedThing.new(params[:learnedthing])
flash[:error] = “Impossible: I can’t add” unless elem.save
else
flash[:error] = “Impossible”
end
redirect_to :action=>“index”
end
Why aren’t there any insertions? ( it returns “Impossible: I can’t add”)