Hi folks,
I’m new to RoR and getting stuck on something that should be quite
simple. I’m just playing with a simple Blog concept, and working on
the “create” view and action. Here are snippets the controller and
view:
====================
def create
@post = Post.new(params[:post])
if request.post?
@post.save
redirect_to :action=>‘index’
end
end
===================
<% form_for :post do |f| %>
Title:
<%= f.text_field :title %>
Content:
<%= f.text_field :content %>
I have probably missed something simple and fundamental but can’t for
the life of me see it. The create controller is not saving or
redirecting to the index page. Please let me know if I need to post
more code.
Any help or suggestions would be greatly appreciated.
Thanks,
Dany.