Sharing view templates between Batman & Rails

38 views
Skip to first unread message

James Mason

unread,
May 8, 2013, 2:18:20 PM5/8/13
to batm...@googlegroups.com
I'm working on a project that's migrating from *a lot* of server-side rendering, to using batman (obviously).

Instead of duplicating views in app/assets/views, why not use app/views directly?

Jeff Berg

unread,
May 8, 2013, 2:26:04 PM5/8/13
to batm...@googlegroups.com
James,

You don't want to render directly from /app/views because you don't want to have to hit the Rails App for every request for a view (unless you need those views to be dynamically generated, which is a bad idea). You could symlink the /app/views to /app/assets/views, but I think that could be messy since they are two different paradigms.

Jeff


On Wed, May 8, 2013 at 11:18 AM, James Mason <bea...@gmail.com> wrote:
I'm working on a project that's migrating from *a lot* of server-side rendering, to using batman (obviously).

Instead of duplicating views in app/assets/views, why not use app/views directly?

--
You received this message because you are subscribed to the Google Groups "batman.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to batmanjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jeff Berg
Owner/Developer
Ministry Centered Technologies
=================================
REVOLUTIONIZE the way you plan your SERVICES at planningcenteronline.com
REVOLUTIONIZE the way you plan your EVENTS at smartevents.com

Kristian Plettenberg-Dussault

unread,
May 8, 2013, 5:36:46 PM5/8/13
to batm...@googlegroups.com, je...@ministrycentered.com
We use app/assets/views because it will go through the Rails asset pipeline and be compiled in to a single asset bundle.  Depending on the size of your app, this is likely perfectly acceptable.

I'd recommend keeping the two domains separate to avoid any confusion moving forward.  Also, it's important to note that our most recent version of batman now separates app/assets/views and app/assets/html. /views is used for view classes when you need to provide custom functionality surrounding the view. /html is used for html templates with batman js markup.

Does that clarify anything?
Reply all
Reply to author
Forward
0 new messages