it might make sense to package those two in their own tag then, unless
you can see a case where you need more than one on a page.  that way,
you don't have to worry about having to manually add it for certain
pages or have it cluttering up pages that don't use it.  maybe like
this...

<def tag="ratings" attrs="dimension">
  <%= ratings_for this, current_user, :dimension => dimension %>
  <%= ajaxful_rating_style %>
</def>

then call it like
<ratings />

not that it saves a lot of code, but I like to hide away erb that's
going to be used more than once in a tag.  keeps the end view cleaner
and clearer IMHO

On May 14, 2:39 pm, Chris Apolzon <[email protected]> wrote:
> Ah, that makes sense.  And yes, the styles created by their cssbuilder are
> dynamic (built based on number of stars possible etc).  Its just the width
> and z-index that is calculated this way, all the other styles are in a
> normal stylesheet which is included.
>
> On Fri, May 14, 2010 at 4:19 PM, kevinpfromnm <[email protected]>wrote:
>
>
>
> > oh, if it's doing something besides just generating the css in the
> > method or depends on variables being set by the other method, that
> > would explain the problem.
>
> > rails evaluates things backwards so layout is the last part evaluated
> > while hobo just goes down the tags.  rails does it so you can set
> > certain variables and have them available to the layout on a per view
> > standpoint.  basically, it's to let the view change part of the
> > layout.  since dryml lets you override any part of the page def, there
> > isn't the need for this kind of process.
>
> > On May 14, 1:44 pm, Chris Apolzon <[email protected]> wrote:
> > > I've managed to get it working.  The problems all stemmed from the order
> > > that Hobo was issuing some tags.  Basically, the ajaxful_rating readme
> > says
> > > to add <%= ajaxful_rating_style %> to your layout.  Since Hobo doesn't
> > > really have layouts per-se, I tried adding it to the stylesheets section
> > of
> > > <page>.  You are then supposed to add the call to ratings_for in your
> > view.
>
> > > In rails, the view tag is called before the ajaxful_rating_style is (I'm
> > not
> > > sure why, it seems kinda odd to me).  But in Hobo, the
> > ajaxful_rating_style
> > > tag is called first.  This is problematic because it is the view tag that
> > > actually generates the inline css to make everything work; thus it was
> > > adding a blank set of styles, then generating the styles later on but
> > never
> > > adding them to the page.
>
> > > My hacky solution was simply this:
>
> > > <show-page>
> > > <append-body:>
> > > <%= ratings_for @book, @current_user, :dimension => :speed %>
> > > </append-body:>
> > > <after-body:>
> > > <%= ajaxful_rating_style %>
> > > </after-body:>
> > > </show-page>
>
> > > I think putting the ajaxful_rating_style anywhere after the DOM location
> > of
> > > the ratings_for call will make it work.
>
> > > I'd love to hear back from other users as to whether this seems like a
> > Hobo
> > > bug or not.
>
> > > On Fri, May 14, 2010 at 9:24 AM, Owen Dall <[email protected]> wrote:
> > > > Tom Locke did this a long time ago for a client demo, if my memory is
> > > > correct.  This would be a great recipe to share if we can track it
> > down!
>
> > > > -Owen
>
> > > > On Thu, May 13, 2010 at 12:47 PM, Chris Apolzon <[email protected]>
> > wrote:
>
> > > >> Has anyone managed to wrangle ajaxful rating into a Hobo site?  I've
> > > >> taken a couple stabs at it, but have come up mostly empty.  Last night
> > > >> I tracked down the first issue, which is that the px width is not
> > > >> being set on the UL holding the stars, but it seems like there's also
> > > >> some javascript issue.
>
> > > >> I'm going to keep hacking on this and hopefully come up with a
> > > >> solution, but if anyone has any ideas or prior experience, I'd love a
> > > >> pointer in the right direction.
>
> > > >> (For what its worth, when I was debugging, it looked like the width
> > > >> was calculated properly and added to the CSS builder but it never
> > > >> makes it onto the page.  Even if you remove all other stylesheets that
> > > >> style is overwritten or disallowed somewhere in Hobo).
>
> > > >> Thanks!
>
> > > >> --
> > > >> 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]<hobousers%[email protected]>
> > <hobousers%[email protected]<hobousers%[email protected]>
>
> > > >> .
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/hobousers?hl=en.
>
> > > > --
> > > > Thanks,
> > > > - Owen
>
> > > > Owen Dall, Chief Systems Architect
> > > > Barquin International
> > > > Cell: 410-991-0811
>
> > > >  --
> > > > 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]<hobousers%[email protected]>
> > <hobousers%[email protected]<hobousers%[email protected]>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/hobousers?hl=en.
>
> > > --
> > > 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]<hobousers%[email protected]>
> > .
> > > For more options, visit this group athttp://
> > groups.google.com/group/hobousers?hl=en.
>
> > --
> > 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]<hobousers%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/hobousers?hl=en.
>
> --
> 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 
> athttp://groups.google.com/group/hobousers?hl=en.

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