"ticket"} - @ticket. Each do |ticket| %h1 = ticket. Slug and it work..." />

Sinatra, select from Datamapper pass to Haml?

Changed ticket %div{:class => "ticket"} = @ticket. Slug to ticket %div{:class => "ticket"} - @ticket. Each do |ticket| %h1 = ticket.

Slug and it works.

Changed @@ ticket %div{:class => "ticket"} = @ticket. Slug to @@ ticket %div{:class => "ticket"} - @ticket. Each do |ticket| %h1 = ticket.

Slug and it works.

Kinda sorta works, but not -- I'm stuck with only 1 ticket at all endpoints, the first I select which is a new issue. – anastazja Aug 19 '10 at 0:35 This is realllly annoying,I'm not passing or unpacking @ticket correctly. – anastazja Aug 19 '10 at 1:31.

Perhaps the issue is with the construction of the model and querying with DM (there is basic info on the site, but looking further for info has been scary to say the least -pages of rdoc classes and methods that don't point anywhere for the basic level I'm at) Ticket. Get(params:slug) gives some sort of null error -- the query pulls nothing, maybe 'slug' needs to be made into some sort of key?

Get '/:slug' do @ticket=Ticket. First(:slug=>params:slug) haml '%h1= @ticket. Slug' end and variations render perfectly, so part of the issue may be improper querying with DM.

The answer was mostly in the datamapper query. Insanely helpful, discovered after the fact: cheat.errtheblog.com/s/datamapper/ the end of this issue, maybe useful to someone else.

The issue I'm having is that I'm able to pass a selection of all tickets, but not a selection of one ticket. I'm relatively new to Ruby and cutting and pasting, but it seems passing @ticket to get @ticket. Slug is right from the Sinatra documentation.

I've gotten to this point and reached an impasse where I am trying to create a simple endpoint for 1 ticket. Any suggestions while I try to read what I'm doing, thanks.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions