In an attempt to provide a gracefully degradable link_to_remote, I repeat myself every time: <%= link_to_remote(''Signup'', {:url => {:controller => ''user'', :action => ''signup''}}, {:href => url_for(:controller => ''user'', :action => ''signup'')}) %> Looked around the RDoc & this forum, I couldn''t see anything obvious. Without specifying the :href, I will get a "#" for href. Anything out there that is able to DRY the above code? TIA! -- Posted via ruby-forum.com.
As a simple solution, you could just create your own helper.... def link_to_both text, options link_to_remote text, options, :href => url_for( options[:url] ) end link_to_both ''Signup'', :url => { :controller => ''user'', :action => ''signup'' } mark On 6/24/06, Doug Dupory <dudupy@gmail.com> wrote:> > In an attempt to provide a gracefully degradable link_to_remote, I > repeat myself every time: > <%= link_to_remote(''Signup'', > {:url => {:controller => ''user'', :action => ''signup''}}, > {:href => url_for(:controller => ''user'', :action => ''signup'')}) %> > > Looked around the RDoc & this forum, I couldn''t see anything obvious. > Without specifying the :href, I will get a "#" for href. Anything out > there that is able to DRY the above code? > > TIA! > > -- > Posted via ruby-forum.com. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails >-- Mark Van Holstyn mvette13@gmail.com lotswholetime.com -------------- next part -------------- An HTML attachment was scrubbed... URL: wrath.rubyonrails.org/pipermail/rails/attachments/20060624/8fbd6097/attachment.html