Thanks Stylpe,
I correct mine as below and it works now.
#content
%h2
/== Your #...@book_marks.length} bookmarks
== Play Responsibly
%p= @lotto.printLottery
%form{:method => "post", :action => ""}
%input{:type => "hidden", :name => "_method", :value => "get"}
%input{:type => "submit", :value => "Get"}
---
And here is my sinatra app:
#myapp.rb
require 'rubygems'
require 'sinatra'
require 'lottery'
require 'haml'
before do
@lotto = Lottery.new(5, 56, "Y", 43)
end
get '/' do
haml :index
end
--------------
Luan
On Mar 30, 11:13 am, Stylpe <[email protected]> wrote:
> Could it be as simple as you forgot to indent your %input line?
>
> On 30 Mar, 15:17, Luan <[email protected]> wrote:
>
>
>
> > Hi All,
>
> > Right now I can refresh a page by pressing F5.
> > What if I want to create a button, when a user click on it, it will
> > refresh a page.
>
> > #content
> > %h2
> > /== Your #...@book_marks.length} bookmarks
> > == Play Responsibly
> > %p= @lotto.printLottery
>
> > %form{:method => "post", :action => "/"}
> > / input{:type => "hidden", :name => "_method", :value => "post"}
> > %input{:type => "submit", :action => "/refresh/", :value => "Get"}
>
> > I had the code above, but it's not working. I am using this with
> > Sinatra web framework.
>
> > Thanks,
> > Luan
--
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.