This is my bold attempt at creating something -without- the ‘generate’
script. No scaffold, just barebone man work!
Of course, it breaks. Let’s see how far I can push the conversation
before I can’t answer my own questions.
WHAT BREAKS?
This is my view in HAML:
— index.html.haml —
%h1
%center Improperly named unread ultrasounds
%p
=button_to_remote “Fix ultrasounds”, {:action => ‘fix_ultrasounds’,
:controller => ‘ultrasounds’, :update => “results”}
#results
=render :text => “”
%table
%tr
%th Procedure
%th Key
-
@broken_ultrasounds.each do |us|
%tr{ :class => cycle(“even”, “odd”) }
%td= us[0]
%td= us[1]
The “button_to_remote” gives me the following error when I click on it:
Unknown action
No action responded to create. Actions: fix_ultrasounds and index
Okay, well, WHAT DO THE LOGS SAY?
Processing UltrasoundsController#index (for 127.0.0.1 at 2009-12-14
10:59:45) [GET]
Rendering template within layouts/application
Rendering ultrasounds/index
Completed in 297ms (View: 16, DB: 0) | 200 OK
[http://localhost/ultrasounds]
Processing UltrasoundsController#create (for 127.0.0.1 at 2009-12-14
10:59:46) [POST]
Parameters:
{“authenticity_token”=>“I7ucDb3iTXMpaFeRdCjTGtu6qFSgSq92VBCKg4SIcFA=”
Why is it asking for “create” ? It should ask for “fix_ultrasounds”,
which is a valid method. As the error message indicates, I only have two
actions in the “ultrasounds” controller …