On Apr 15, 2011, at 11:01 AM, Tim Griffin wrote:

> 
> Just for the info of anyone else trying to put the login-form on the 
> front#index page, here's what you need to add in the content-body section of 
> front/index.dryml:
> 
>   <login-form user-model="&User" action="&user_login_path" if="&!logged_in?"/>
> 
> (assuming you are using the default 'User' model, and default login path). 
> 
> It took me a little hacking until I figured out that the user-model parameter 
> of the <login-form> tag has to be evaluated with "&", although I'm not 
> entirely sure why, so perhaps the experts could explain?

Attributes whose values start with & are treated as Ruby code and get evaluated 
then passed to the tag (OK, not exactly, but that's the net effect). Thus, this:

<login-form user-model="&User" />

is quite different from:

<login-form user-model="User" />

The user_model variable in the former will have the constant User; the latter 
will have the literal string 'User'.

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to