mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
95 lines
2.1 KiB
Text
95 lines
2.1 KiB
Text
= h("&&&&&&&&&&&") # This is an ActionView Helper... should load
|
|
- foo = capture do # This ActionView Helper is designed for ERB, but should work with haml
|
|
%div
|
|
%p.title Title
|
|
%p.text
|
|
Woah this is really crazy
|
|
I mean wow,
|
|
man.
|
|
- 3.times do
|
|
= foo
|
|
%p foo
|
|
- tab_up
|
|
%p reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally loooooooooooooooooong
|
|
- tab_down
|
|
.woah
|
|
#funky
|
|
= capture_haml do
|
|
%div
|
|
%h1 Big!
|
|
%p Small
|
|
/ Invisible
|
|
= capture do
|
|
.dilly
|
|
%p foo
|
|
%h1 bar
|
|
= surround '(', ')' do
|
|
%strong parentheses!
|
|
= precede '*' do
|
|
%span.small Not really
|
|
click
|
|
= succeed '.' do
|
|
%a{:href=>"thing"} here
|
|
%p baz
|
|
- haml_buffer.tabulation = 10
|
|
%p boom
|
|
- concat "foo\n"
|
|
- haml_buffer.tabulation = 0
|
|
-#
|
|
-# ActionPack pre-2.0 has weird url_for issues here.
|
|
- if ActionPack::VERSION::MAJOR < 2
|
|
:plain
|
|
<p>
|
|
<form action="" method="post">
|
|
</p>
|
|
<div>
|
|
<form action="" method="post">
|
|
<div><input name="commit" type="submit" value="save" /></div>
|
|
<p>
|
|
@foo =
|
|
value one
|
|
</p>
|
|
Toplevel? false
|
|
<p>
|
|
@foo =
|
|
value three
|
|
</p>
|
|
</form>
|
|
<form action="" method="post">
|
|
Title:
|
|
<input id="article_title" name="article[title]" size="30" type="text" value="Hello" />
|
|
Body:
|
|
<input id="article_body" name="article[body]" size="30" type="text" value="World" />
|
|
</form>
|
|
</div>
|
|
- else
|
|
%p
|
|
= form_tag ''
|
|
%div
|
|
- form_tag '' do
|
|
%div= submit_tag 'save'
|
|
- @foo = 'value one'
|
|
= test_partial 'partial'
|
|
- form_for :article, @article, :url => '' do |f|
|
|
Title:
|
|
= f.text_field :title
|
|
Body:
|
|
= f.text_field :body
|
|
= list_of({:google => 'http://www.google.com'}) do |name, link|
|
|
%a{ :href => link }= name
|
|
%p
|
|
- haml_concat "foo"
|
|
%div
|
|
- haml_concat "bar"
|
|
- haml_concat "boom"
|
|
baz
|
|
- haml_concat "boom, again"
|
|
- haml_tag :table do
|
|
- haml_tag :tr do
|
|
- haml_tag :td, {:class => 'cell'} do
|
|
- haml_tag :strong, "strong!"
|
|
- haml_concat "data"
|
|
- haml_tag :td do
|
|
- haml_concat "more_data"
|
|
- haml_tag :hr
|
|
- haml_tag :div, ''
|