On Nov 17, 2009, at 5:06 AM, Dan wrote:

> I'll start of by saying I'm new to both Ruby on Rails and Hobo so if
> you have an answer please make it as clear as possible :) (I have a
> feeling that trying to learn both at the same time was a mistake
> because now I'm not sure what's RoR and what's Hobo, but oh well).
>
> I'm attempting to customise the default Hobo signup page to look
> something like this:
>
> Section 1: [require info]
> Username:
> Password:
> etc...
>
> Section 2: [not required]
> More stuff
>
> Section 3: [not required]
>
> Agree to Terms and Conditions [required]
>
> ------
>
> I've been looking around the forum for a solution to the problem, but
> so far I've only had a little success. Using /views/users/signup.dryml
> I've been able to add content using to the page using something like
> this:
>
> <signup-page>
>        <prepend-content-body:>
>                Content goes here.
>        </prepend-content-body:>
> </signup-page>
>
> or change the content of the signup form:
>
> <signup-page>
>  <form:>
>    <field-list: replace>
>      <field-list fields="name, email_address, password" />
>    </field-list:>
>  </form:>
> </signup-page>
>
> But can't seem to do both / split it up in the way I need. I'm sure
> I'm missing some basic understanding of something that should make
> this really easy but at the moment it feels like I'm banging my head
> on a wall and making little progress.
>


If you're heavily modifying the page, I'd recommend grabbing the  
definitions from app/views/taglibs/auto/rapid/pages.dryml and  
forms.dryml and just writing the page out directly, like this:

<page title="Signup">

   <body: class="lifecycle-start-page signup-page" />

   <content:>
     <header class="content-header">
       <h2 class="heading">
         Signup
       </h2>
     </header>

     <section class="content-body">
       <form lifecycle="signup">
         <error-messages />
         <field-list fields="name, email_address, password,  
password_confirmation" />
         <div class="actions">
           <submit label="Signup" /><or-cancel class="cancel"/>
         </div>
       </form>
     </section>
   </content:>

</page>

This is the result of:

- expanding the definition of <signup-page>
- expanding the definition of <signup-form>
- remove every 'merge' attribute
- remove bare 'param' attributes
- named param attributes (param="foo") turn into class="foo"
- I also removed the ht stuff, to further clarify what's going on.  
You'll probably want to leave it in.

If you put this in your signup.dryml, it should produce a page that  
looks just like the stock page. From there, it should be a lot clearer  
how to go about modifying the structure to suit your exact requirements.

Note that this isn't the DRYest thing in the world, but it's the  
preferred method once you start heavily altering page content or  
structure.

This reminds me that I still owe the cookbook that "page  
customization" tutorial...

Hope this helps!

--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