The third argument to the ActionView::Base is an actual instance of a
controller. You need it to do stuff like url_for and link_to in ActionView.
The way Rails works is to render templates (both Haml and ERB) in an
ActionView instance, giving you access to all the handy helpers. You
could do it in a model like User, but then you wouldn't have access to
the helpers but would instead have access to the User's variables, which
would be weird.
- Nathan
[EMAIL PROTECTED] wrote:
> Hey Nathan,
>
> Context thing definitely makes sense to me now. However I have
> difficulty properly setting up that base variable.
>
> So if I do
>
>
>>> base = ActiveRecord::Base.new('app/views', {}, ContentController)
>>>
> NameError: uninitialized constant ContentController
>
> I have ContentController that is not tied to any model there.
> Obviously I'm doing this completely wrong.
>
> also
> base = User.new doesn't really provide context that I'm looking for?
> Different thing?
>
> Thanks
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" 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/haml?hl=en
-~----------~----~----~----~------~----~------~--~---