What are they?
--
James Britt
www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff
> "merb-slices are “Little slices of MVC cake”. These are self contained
> merb apps with models, controlers, views and assets that you can
> distribute as rubygems. You can mount a merb-slice at a specific point
> in your router definition and you can override any part of the slice
> up in your main app. So in a way these are similar to what Rails-
> Engines promise, except merb-slices are built into the framework and
> will not break when merb itself is updated." ezra
>
>
> On Dec 7, 4:18 am, Arne Brasseur <Arne.Brass...@gmail.com> wrote:
>> I'm guessing Ramaze people don't feel the need for any special feature
>> to do this. You can easily write models and controllers that are
>> reusable, for the views I suppose you'd have to add a search path somewhere.
>>
Idle speculation:
If I gem up some classes that define some controllers and models, and
require gem that in my Ramaze start.rb in another app, would Ramaze not
treat them the same as if they were local files on a relative path? Is
it correct that Ramaze doesn't care where you put your controllers and
models? (A quick test with an app that loads some controllers from a
directory in another app suggests this is true.)
I think rendering views would be an issue, on the assumption that a
Ramaze app *does* seem to assume a local relative path (I'm guessing
there's a call to IO.read(view_path_thing) or similar in the libs).
If Ramaze knew to look in a gem's own directories, though, then it might
work fine. (I'm curious, though, if using a third-party view would be
so ideal. I think I'd rather be able to ask a Ramaze-slice gem to write
out it's view files locally so I could then edit them to suit my apps
look and feel.)
Perhaps if the gem'ed slice set the template root using a reference to
__FILE__ or __DIR__ then the controlling app would know where to look.
--
James Britt
www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
It seems to me that a good approach may be to package up only the
model and controller portions, and provide bare bones view material by
way of example that is meant to be copied and adjusted to fit within
an existing app.
One issue, though, is that packaging up model code as well may mean
yoking to a particular ORM -- unless support for more than one were
put into the package?
--
Pistos
http://blog.purepistos.net