Serving HAML assets outside of controllers

70 views
Skip to first unread message

Jayme Edwards

unread,
Aug 23, 2011, 12:35:54 PM8/23/11
to rubyonra...@googlegroups.com
Hey guys,

I've got a rails app using Knockout.js and Path.js to do the UI, so all the HTML is built as separate HTML fragments that are dynamically downloaded by the browser and applied using JQuery templating. I LOVE haml and want to use it to write these templates, but I have no need for inline ruby or access to the controller and would prefer not to have to build routes just to serve them. Is there a way to use HAML outside of views, in the assets folder or the public folder that wouldn't require me defining separate routes, but will still allow me to use it in development while deploying the generated HTML to production? I know this could be a question for the HAML group but I have a feeling it may have something to do with a configuration of the asset pipeline. I'm using 3.1 RC6.

Thanks in advance,

Jayme

Jim Ruther Nill

unread,
Aug 24, 2011, 9:42:16 AM8/24/11
to rubyonra...@googlegroups.com
On Wed, Aug 24, 2011 at 12:35 AM, Jayme Edwards <jayme....@gmail.com> wrote:
Hey guys,

I've got a rails app using Knockout.js and Path.js to do the UI, so all the HTML is built as separate HTML fragments that are dynamically downloaded by the browser and applied using JQuery templating. I LOVE haml and want to use it to write these templates, but I have no need for inline ruby or access to the controller and would prefer not to have to build routes just to serve them. Is there a way to use HAML outside of views, in the assets folder or the public folder that wouldn't require me defining separate routes, but will still allow me to use it in development while deploying the generated HTML to production? I know this could be a question for the HAML group but I have a feeling it may have something to do with a configuration of the asset pipeline. I'm using 3.1 RC6.


I believe haml install an haml executable which you can use to convert haml files to html.
You might want to check that out if that suits your needs :)
 
Thanks in advance,

Jayme

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/aPQ4fuJ44CYJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.



--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

Jayme Edwards

unread,
Aug 25, 2011, 9:48:22 AM8/25/11
to rubyonra...@googlegroups.com
Any advice on how to hook this into the asset pipeline so it executes whenever I update files?

Jim Ruther Nill

unread,
Aug 27, 2011, 8:15:56 PM8/27/11
to rubyonra...@googlegroups.com
On Thu, Aug 25, 2011 at 9:48 PM, Jayme Edwards <jayme....@gmail.com> wrote: 
Any advice on how to hook this into the asset pipeline so it executes whenever I update files?

Sorry I don't get what you mean.  From what I understand of your requirements, you want to
convert haml to html without rails doing it for you. if that's the case, then i think you can use the
haml executable that comes with the gem.  But I think you need to require files so that you can use
the rails helpers.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/MQgIG70FDRAJ.

To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Reply all
Reply to author
Forward
0 new messages