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 ) %>
<br /><%= 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")
--
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
-~----------~----~----~----~------~----~------~--~---