# Form\_for help needed

**URL:** <https://www.ruby-forum.com/t/form-for-help-needed/173619>\
**Category:** Rails\
**Created:** [August 12, 2009, 4:31am UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619 "2009-08-12T04:31:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 4:31am UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/1 "2009-08-12T04:31:05Z")

</div>

here is the scenario:

i have a form ( with couple of simple validations ) for the new action:

\<% form\_for :classified, @classified, :url=\>{  
:controller=\>‘classifieds’, :action=\>‘create’}, :html =\> { :multipart =\>  
true } do |f| %\>  
\<%= error\_messages\_for ‘classified’ %\>

\<%= submit\_tag ‘Post’ %\>  
\<% end %\>

when I click submit button without entering anything, it triggers  
validation and comes back with necessary error messages on all browsers.  
The view source html on firefox, ie displays

However, in google chrome, it shows an exception saying that index  
action not found – here it is.

# Unknown action

No action responded to index. Actions: create, delete, edit, new, show, simple\_captcha\_valid?, and update

IE and firefox do not show this error.

Am I doing anything wrong? or is it a Chrome issue?

Any help is much appreciated.

---

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 7:00am UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/2 "2009-08-12T07:00:33Z")

</div>

I tried this again with scaffold. When the validation is triggered,  
Chrome executes index action at the background (right click your browser  
and view source).

I guess, we have to assume that the http verb being used by chrome  
appear to be ‘GET’ rather than ‘POST’.

Has anyone encountered similar issue?. How did you resolve this?. If  
not, can it be ignored?

## To reproduce, do the following

1. create table ‘mytable’ with just one column ( ex: name )
2. use scaffold – script/generate scaffold mytable name:string
3. insert a validation in mytable model – validates\_presence\_of :name

Now, using chrome browser, try to insert a new ‘blank’ record. This  
will trigger your model validation. Now right click and view source.

---

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 7:13am UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/3 "2009-08-12T07:13:25Z")

</div>

\<% form\_for :classified, @classified, :url=\>{  
in this not both required remove @classified and try to run it

---

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 7:24am UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/4 "2009-08-12T07:24:20Z")

</div>

Wap A. wrote:

> \<% form\_for :classified, @classified, :url=\>{  
> in this not both required remove @classified and try to run it

No change even after trying with

\<% form\_for(@classified, :html =\> { :multipart =\> true }) do |f| %\>

---

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 7:51am UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/5 "2009-08-12T07:51:05Z")

</div>

Wap A., thanks for your suggestions. But they are not working. Are  
they working for you?. Did you try it in Chrome for this or any of your  
rails app?

---

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 7:38am UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/6 "2009-08-12T07:38:44Z")

</div>

\<% form\_for :classified, :url=\>{  
:controller=\>‘classifieds’, :action=\>‘create’}, :html =\> { :multipart =\>  
true } do |f| %\>  
\<%= error\_messages\_for ‘classified’ %\>

\<%= submit\_tag ‘Post’ %\>  
\<% end %\>

write like this no for \<% form\_for(@classified, :html =\> { :multipart =\>  
true }) do |f| %\> this

in ur case there are two parameter :classified,@classified required only  
1 :classified/@classified

---

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 4:59pm UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/7 "2009-08-12T16:59:14Z")

</div>

On Wed, 2009-08-12 at 07:00 +0200, Rails L. wrote:

> I guess, we have to assume that the http verb being used by chrome  
> appear to be ‘GET’ rather than ‘POST’.

You shouldn’t have to assume anything. I haven’t used Chrome but it’s  
difficult to believe that there aren’t tools equivalent to Firebug, Live  
Http Headers, etc. to assist developers targeting that platform. If  
there aren’t, then I personally wouldn’t waste time developing for it.  
At a minimum, using Mongrel as your server, your log file will tell you  
the http verbs being used for each request.

HTH,  
Bill

---

<div class="post-metadata">

**Author:** ![railslist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@railslist](https://www.ruby-forum.com/u/railslist)\
**Post date:** [August 12, 2009, 5:12pm UTC](https://www.ruby-forum.com/t/form-for-help-needed/173619/8 "2009-08-12T17:12:41Z")

</div>

On Wed, Aug 12, 2009 at 9:59 AM, bill walton[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I haven’t used Chrome but it’s  
> difficult to believe that there aren’t tools equivalent to Firebug, Live  
> Http Headers, etc. to assist developers targeting that platform. If  
> there aren’t

The nightly PPA Chrome builds do provide some fairly decent developer  
tools.

Page Button → Developer → Developer Tools.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)
