[EMAIL PROTECTED] wrote: > What we were talking about, was, the idea that models and views > shouldn't really interact; rather, we could define an interface between > the model and the view, similar to the way Liquid templates use a Drop > to limit the fields to which you have access. > > The idea being, you could turn around the helpers so you're doing > > <%= @user.link %> rather than <%= link_to @user.name, > user_path(@user) %> or whatever it is.
Hmm, I missed the specifics of that conversation, but here are some thoughts: I like the idea of turning the helpers "around" like you mentioned, but the example you gave seems to go a little too far, i.e. now we're putting view logic in the model, even if it's done with a mixin. Perhaps a better (?) separation would be to leave link_to as a "view helper" and then #path just becomes a method on AR::Base (or wherever): <%= link_to @user.name, @user.path %> I guess the problem is that it's not *that* much less code, but feels ever so slightly cleaner (and DRY) to me, compared to: <%= link_to @user.name, user_path(@user) %> Then again I don't know what anyone has planned along these lines. Tony --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
