Hello I''m a newcomer in the Masterview world I''m trying to use it whith a litlle REST project. I''d like to generate for instance : --- <%= link_to( ''Show'', user_path(user) ) %> --- (REST controller named UsersController in users_controller.rb) I don''t understand the code for directive link_to : --- attr_arg :name do |value, args| if value.include?(''=>'') : args.unshift(value); end; nil; end # if hash push back on, discard name attr_arg :options, :default => {} attr_arg :html_options, :default => {}, :append_element_attrs => [:common_html] attr_arg :params, :varargs => true event :element do render erb_content(''link_to'', quote(content_string), :options, :html_options, :params) end --- If I''m correct, the first argument is ignored, isn''t it ? After several tries, I ended up with something like : --- <a class="show_link" href="show.html" mv:link_to="garbage, user_path(user)">Show</a> --- It seems I''m missing something with the correct usage of the first argument. Any insight would be much appreciated As usual, sorry for crappy english
On 7/18/07, Pierre Gambarotto <pierre.gambarotto at enseeiht.fr> wrote:> > Hello I''m a newcomer in the Masterview world > > I''m trying to use it whith a litlle REST project. > I''d like to generate for instance : > --- > <%= link_to( ''Show'', user_path(user) ) %> > --- > > (REST controller named UsersController in users_controller.rb) > > > If I''m correct, the first argument is ignored, isn''t it ? > After several tries, I ended up with something like : > --- > <a class="show_link" href="show.html" mv:link_to="garbage, > user_path(user)">Show</a> > --- > > It seems I''m missing something with the correct usage of the first > argument. > > Any insight would be much appreciatedYes, the first argument is optional to match the syntax of the original link_to helper. Try this and see if it works <a class="show_link" href="show.html" mv:link_to=":action => ''show'' ">Show</a> I believe there might be a parsing issue when using the new url_ rest style helpers with MasterView. Something that is on my plate to look at. In the meantime you can still use the hash style argument and it should work fine. Let me know if you have any problems. Blessings, Jeff -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20070723/0e4d5424/attachment.html