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 <form action="/classifieds" enctype="multipart/form-data" method="post"> However, in google chrome, it shows an exception saying that index action not found -- here it is. <h1>Unknown action</h1> <p>No action responded to index. Actions: create, delete, edit, new, show, simple_captcha_valid?, and update</p> IE and firefox do not show this error. Am I doing anything wrong? or is it a Chrome issue? Any help is much appreciated. -- Posted via http://www.ruby-forum.com/.
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. -- Posted via http://www.ruby-forum.com/.
<% form_for :classified, @classified, :url=>{ in this not both required remove @classified and try to run it -- Posted via http://www.ruby-forum.com/.
Wap Addon wrote:> > <% form_for :classified, @classified, :url=>{ > in this not both required remove @classified and try to run itNo change even after trying with <% form_for(@classified, :html => { :multipart => true }) do |f| %> -- Posted via http://www.ruby-forum.com/.
<% 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 -- Posted via http://www.ruby-forum.com/.
Wap Addon, 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? -- Posted via http://www.ruby-forum.com/.
On Wed, 2009-08-12 at 07:00 +0200, Rails List 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
On Wed, Aug 12, 2009 at 9:59 AM, bill walton<bwalton.im-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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''tThe nightly PPA Chrome builds do provide some fairly decent developer tools. Page Button -> Developer -> Developer Tools. -- Greg Donald http://destiney.com/