Non-ruby folks will probably prefer the html-like attribute syntax:

%form(action="myaction" method="post")

%input(type="text" name="foo" value="bar" maxlength="100")

Chris


On Fri, Jan 22, 2010 at 5:15 PM, Amy L <[email protected]> wrote:

> Hi mmr,
>
> If you know HTML then picking up Haml is a no-brainer. Let's say you want a
> form and you're not using the form helper, instead of writing:
>
> <form action="..." method="post">
>
> You write
>
> %form{:action => '...', :method => 'post'}
>
> For the stuff you would put inside the <form> tags just indent by 2 spaces
> in Haml. That's pretty much it.
>
> So you want a text field? Sure:
>
> %input{:type => 'text', :name => '...', :value => '...', :maxlength =>
> '...'}
>
> That's it.
>
>
> On Fri, Jan 22, 2010 at 3:43 PM, mmr <[email protected]> wrote:
>
>> Hi all,
>>
>> I'm putting together a web system basically as described here:
>>
>> http://stackoverflow.com/questions/2112267/should-i-be-using-rails-or-ruby-for-this-website-application-how/2112446#2112446
>>
>> I've decided to go with sinatra, mainly because I don't need the db
>> functionality of rails as that's already covered by a java environment
>> that I have definitely working and debugged.
>>
>> However, when I read the tutorials for haml and sass, they all
>> reference erb and css.  I have no knowledge of erb or css, so those
>> tutorials are useless to me.
>>
>> I've found this tutorial on making a login page (my next task):
>>
>> http://visionmasterdesigns.com/tutorial-create-a-login-system-in-ruby-on-rails/
>>
>> But that's in erb and it's specifically for rails on top of mysql,
>> which, again, I'm not doing.
>>
>> Is there an equivalent tutorial for a simple login page?  I'm talking
>> just "here's a box in which to put text, and here's how to access that
>> text in your ruby file", nothing particularly complicated.
>>
>> Overall, a very useful listing for me would be how to:
>> 1) write normal text (as in, <br>This is my text!  Isn't it awesome!
>> <br>
>> 2) write a link
>> 3) write a link bar across the top (or bottom) of a page, with say,
>> five or six links to pages in the site
>> 4) have a text entry field
>> 5) have a button that does something when clicked
>>
>> I think that would cover my needs for the moment.  I just don't see
>> any straightforward way to do these things, and any help would be
>> appreciated.
>>
>> 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] <haml%[email protected]>.
>> For more options, visit this group at
>> http://groups.google.com/group/haml?hl=en.
>>
>>
>  --
> 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] <haml%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>

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

Reply via email to