Hi

WOW! Is Rails 3 another interesting learning curve. Just when I think
I have a general working knowledge of Rails 2 ... things change.

I'm trying to replicate the following in Rails 3:

<%= link_to_remote image_tag("creditcard.png", :border => 0), :url =>
{:action => :make_payment, :type => "Credit", :id =>
@appt.id }, :with=>"'amount='+$F('amount')", :complete =>
remote_function( :url => { :action => :load_appt, :id => @appt.id })
%>

Obviously, when I click a link, I want some action and controller to
trigger and something to happen to the page that the link is part of.

I've watched what feels like EVERY railscast on the internet and read
every Rails 3 tutorial out there. I've got a basic understand of UJS
and see the benefits etc ... but all I want to do is click a link,
some controller action trigger, a render :update do |page| call to
trigger and then I'll be happy!!

But no luck so far ...

So ... with the following line:

<%= link_to "Add Photos", entries_path, {:controller
=> :entries, :action => :showphotos, :remote => true} %>

I get the following error:

Started GET "/entries" for 127.0.0.1 at Fri Aug 13 23:13:18 +0100 2010
  Processing by EntriesController#index as JS
Rendered entries/index.js.erb (0.2ms)
Completed 200 OK in 15ms (Views: 15.1ms | ActiveRecord: 0.0ms)
Started GET "/images/test.png" for 127.0.0.1 at Fri Aug 13 23:13:18
+0100 2010
ActionController::RoutingError (No route matches "/images/test.png"):
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.rc/lib/
action_dispatch/middleware/templates/rescues/routing_error.erb within
rescues/layout (0.6ms)

It's calling a GET to /entries and only calling some JS I have in
index.js ...

Not calling the showphotos action.

This is really holding me back now as I can't for the life of me find
a solution or something which makes sense.

Any ideas please from knowledgeable Rails 3 gurus?

Cheers

Darrne

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to