Now I know this looks odd with the empty controller action, but I would
expect this code to just show a popup window with 'success' and leave
the current page loaded when the link is clicked? Instead i get the
missing template message like its trying to load a page synchronously
rather than using ajax?
Can anyone get my test to work? Do I need to upgrade or add a gem file?
Now I know this looks odd with the empty controller action, but I would
expect this code to just show a popup window with 'success' and leave
the current page loaded when the link is clicked? Instead i get the
missing template message like its trying to load a page synchronously
rather than using ajax?
Can anyone get my test to work? Do I need to upgrade or add a gem file?
Thanks in advance
Jason
What I have noticed is that
1. The javascript syntax is not correct
2. You didn't specify a controller from the link
3. It is probably make more sense to test with Json response using
respond_to :json
respond_with { :status => 'okay' }
Now I know this looks odd with the empty controller action, but I would
expect this code to just show a popup window with 'success' and leave
the current page loaded when the link is clicked? Instead i get the
missing template message like its trying to load a page synchronously
rather than using ajax?
Can anyone get my test to work? Do I need to upgrade or add a gem file?
Thanks in advance
Jason
What I have noticed is that
1. The javascript syntax is not correct
2. You didn't specify a controller from the link
3. It is probably make more sense to test with Json response using
respond_to :json
respond_with { :status => 'okay' }
Thanks Webber
1. Noticed the missing bracket and fixed.
2. Have set a route as follows:
match '/getdiagram', :to => 'prosesses#getDiagram'
It seems to be executing the right controller/action from the error
message i get
3. Tried that but get:
c:/Users/Jason/rails_projects/procstor/app/controllers/prosesses_controller.rb:123:
syntax error, unexpected tASSOC, expecting '}'
respond_with { :status => 'okay' }
^
The parser sees this line as a method with a block and then the => is confusing (not allowed there, it isn't in a Hash)
Either of these changes will do what you expect:
respond_with({ :status => 'okay' }) # no longer looks like a block
respond_with :status => 'okay' # must be a hash literal
respond_with( :status => 'okay' ) # must be a hash literal