On Tue, Mar 8, 2016 at 4:00 PM, David Williams <li...@ruby-forum.com> wrote:
> When I click the submit button, the form automatically refreshes the
> page.

> Started GET
> "/articles/new?
utf8=%E2%9C%93&authenticity_token=GP%2Fm4GX2Z2CUjuFt5QJOEEcIcEtKzsd9nPGQ6OfmMQn2yiUHqwoGPvzQiu2hSiPK0V8%2Br1r%2F0TfC5zZM26Y2VA%3D%3D&article%%5Bcategory_id%5D=1&commit=Create+Article"
> for 127.0.0.1 at 2016-03-08 18:30:00 -0500
> Processing by ArticlesController#new as HTML

It should be pretty apparent that you're accessing the "#new"
method in your controller, NOT the "#create", which would be
done via POST.

> <div class="container">
>   <form class="article-form-template">
>     <%= simple_form_for(@article, html: {class: 'form-horizontal',
> :multipart => true}) do |f| %>

?! You're creating a form tag within a form tag - not valid HTML in
any way. And that outer form has no method or action attributes, so
not much is ever going to happen, as you see :-)

-- 
Hassan Schroeder ------------------------ hassan.schroe...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yC3FGdOy0b5NC2z9PuMhitXyHMdapbpvVjJF%3DQjj5PDww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to