On Mon, Aug 30, 2010 at 2:54 PM, Mark Sobkowicz <[email protected]> wrote:
> Matt, thanks for your help with my last issue, the <after-submit> tag.   That 
> part of my app works great now.
>
> What I have now is a Downloads model, where I have a list of files that 
> students can download.   I put the files in public/files, and in the model 
> have a url field, so  an instance might have a url like "chapter2.pdf".   I'd 
> like the index of downloads to show a list of links to these files, but since 
> I cannot embed ruby in the <a> tag, I'm not sure how to go about it.
>

Side note: if you're going to be uploading a lot of files, take a look
at Paperclip. There's a good tutorial about it on the cookbook, and it
will simplify things.

You can actually use Ruby in tag attributes, just not ERB (the <% %>
tags). Try something like this:

<a href="/files/#{this.url}">Some text</a>

--Matt Jones

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