I would start with something like <img src="#{this.avatar.image_url}"/> (if 
assuming "image" is the name of your paperclip attachment). Then decorate 
that with bootstrap styles/classes or other CSS styling.

Once you are satisfied, you probably will want to move it into a tag 
definition to that you can reuse it other places; whis is very simple:

<def tag="avatar">
  <img src="#{this.avatar.image_url}" whatever="other" customizations="you" 
need="here"/>
</def>

there, now you have a handy <avatar/> tag, now just switch to that in your 
table-plus invocation:

<table-plus: project fields="this, tasker, state, created_at">
    <empty-message:>No projects match your criteria</empty-message:>
    <tasker-view:><view/><avatar/></tasker-view:>
    <controls:>
        <transition-buttons/>
    </controls:>
  </table-plus>

and that's pretty much it I think.

2015. július 31., péntek 19:09:55 UTC+2 időpontban Nathan Peters a 
következőt írta:
>
> I have partially answered my own questions.
>
> Regarding image alignment in the <content-header> on the user show page. I 
> am just using CSS to float the image left. And I'll need to customize 
> anyway so CSS is probably the way to go.
>
> I can almost make the link to the Paperclip attachment work but I am 
> missing something.
>
> <table-plus: project fields="this, tasker, state, created_at">
>     <empty-message:>No projects match your criteria</empty-message:>
>     <tasker-view:><view/><view:avatar if-blank=""/></tasker-view:>
>     <controls:>
>         <transition-buttons/>
>     </controls:>
>   </table-plus>
>
> This code gives me the name of the "tasker" (what would be there normally) 
> and a text of the image attachment path called avatar. I added the if-blank 
> to prevent anything being displayed if no attachment is available.
>
> But I can't seem to figure out how to convert the output of <view:avatar> 
> to an image link. I know <view> wraps different kinds of content. Maybe 
> there is a way to force it to handle images?
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to