For some time now Rails contains a mechanism to extract reusable bits and pieces into components. I don''t remember having seen even a single one. Is anyone actually using components? Michael -- Michael Schuerig Airtight arguments have mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org vacuous conclusions. http://www.schuerig.de/michael/ --A.O. Rorty, Explaining Emotions
Hi Michael, I actually use it for a few things and it seems to be running fine. I can rake, but can''t get stats properly. Other than that it makes it a lot easier to drop it onto another project or site. There are a few others using components too, for instance ActiveRBAC and some bits in typo. Dylan.> For some time now Rails contains a mechanism to extract reusable bits > and pieces into components. I don''t remember having seen even a single > one. Is anyone actually using components? > > Michael > >
> Hi Michael, > > I actually use it for a few things and it seems to be running fine. I > can rake, but can''t get stats properly. Other than that it makes it a > lot easier to drop it onto another project or site. > > There are a few others using components too, for instance ActiveRBAC and > some bits in typo. > > Dylan. > > For some time now Rails contains a mechanism to extract reusable bits > > and pieces into components. I don''t remember having seen even a single > > one. Is anyone actually using components? > > > > MichaelI have Supasite, a component that manages those ''extra'' pages of your app (an about page, faq, etc). It was mostly a test bed for this database-driven routes idea I had, and it''s being used in an internal app at work. It was also the app that I wrote acts_as_versioned for originally. http://projects.techno-weenie.net/supasite/ -- rick http://techno-weenie.net
Hi Michael, I''m using components for almost my entire application. My app essentially lets you build a web portal by adding instances of components to the menu (ie, I''d like an editable page here, a blog here, etc). So, if I go to a certain menu section, the functionality of the main part of the page is generated by the component. Since my components are fairly complex (like a blog), and contain links to other parks of the same component (eg; new entry for this blog), I am probably using them for more than they were intended for. Basically, I''m trying to persuade them to be fully fledged rails apps, and I wish they actually had routes and all the other rails stuff supporting them. I''m happy to go into this further (and show code and examples) if people are interested. Craig Michael Schuerig wrote:>For some time now Rails contains a mechanism to extract reusable bits >and pieces into components. I don''t remember having seen even a single >one. Is anyone actually using components? > >Michael > > >
I believe Mailr is pretty much all components: http://mailr.org/ On 9 Oct 2005, at 04:02, Michael Schuerig wrote:> > For some time now Rails contains a mechanism to extract reusable bits > and pieces into components. I don''t remember having seen even a single > one. Is anyone actually using components? > > Michael > > -- > Michael Schuerig Airtight arguments have > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org vacuous conclusions. > http://www.schuerig.de/michael/ --A.O. Rorty, Explaining Emotions > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Tuesday 11 October 2005 01:18, Craig Ambrose wrote:> Since my components > are fairly complex (like a blog), and contain links to other parks of > the same component (eg; new entry for this blog), I am probably using > them for more than they were intended for.That''s a much larger scale than what I''ve been pondering in the last days, but it''s probably in tune with the idea of components in Rails as DHH set forth (somewhere in the docs section on the website). I''m trying to decide whether and how to make my helper methods for querying/displaying and displaying/editing of x_many associations into components. I was about to start to write methods that generate action methods for ajax request to add/remove an object from an association when it struck me that components might be a better fit for this. Michael -- Michael Schuerig Airtight arguments have mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org vacuous conclusions. http://www.schuerig.de/michael/ --A.O. Rorty, Explaining Emotions
Craig, since you''re using components, maybe you can help me. I have a component that I''m rendering with a layout in my layouts directory. That layout file is rendering a partial in one of my controller directories: <%= render_partial "admin/admin/signinstatus" %> Rails seems to want to look under the components directory for the partial, instead of app/views, and thus can''t find the partial. Have you, or anyone else, run into this issue? Thanks, Brett On Oct 10, 2005, at 6:18 PM, Craig Ambrose wrote:> > Hi Michael, > > I''m using components for almost my entire application. My app > essentially lets you build a web portal by adding instances of > components to the menu (ie, I''d like an editable page here, a blog > here, etc). So, if I go to a certain menu section, the > functionality of the main part of the page is generated by the > component. Since my components are fairly complex (like a blog), > and contain links to other parks of the same component (eg; new > entry for this blog), I am probably using them for more than they > were intended for. Basically, I''m trying to persuade them to be > fully fledged rails apps, and I wish they actually had routes and > all the other rails stuff supporting them. > > I''m happy to go into this further (and show code and examples) if > people are interested. > > Craig > > Michael Schuerig wrote: > > >> For some time now Rails contains a mechanism to extract reusable >> bits and pieces into components. I don''t remember having seen even >> a single one. Is anyone actually using components? >> >> Michael >> >> >> > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hi Brett, No, I hadn''t encoutnered that as I''m not using layouts for my components. Interestingly, I would have expected it to look in the component directory for _both_ the layout and the partial. I don''t understand why a component would reference a layout from the application base, if components are supposed to be decoupled enough to share around between apps. My suggestions would be that if you want to surround your component with a layout, and you want that layout to be based on your base application (rather than the component), then tell the component to render without a layout, and instead do that layout stuff in the thing that calls the component. For example, I load my components from a controller in my application, which does something like: def home_page @calendar = render_component_as_string(...parameters for calendar component...) end Thus the template (and layout) for my home_page action get to put the result of the component (stored in @calendar) wherever they want, and can surround in with menu''s, other content, more components or whatever, and the component doesn''t need to know. regards, Craig Brett Walker wrote:> Craig, since you''re using components, maybe you can help me. I have > a component that I''m rendering with a layout in my layouts > directory. That layout file is rendering a partial in one of my > controller directories: > > <%= render_partial "admin/admin/signinstatus" %> > > Rails seems to want to look under the components directory for the > partial, instead of app/views, and thus can''t find the partial. > > Have you, or anyone else, run into this issue? > > Thanks, > Brett
I encountered this problem when integrating ActiveRBAC. It uses the "uses_component_template_root" to tell the component to find its templates in the layout directory. This makes total sense to me - the component uses full peer level controllers, just like a normal app. It just needs to be able to integrate seamlessly into my app. Brett On Oct 10, 2005, at 10:05 PM, Craig Ambrose wrote:> > Hi Brett, > > No, I hadn''t encoutnered that as I''m not using layouts for my > components. Interestingly, I would have expected it to look in the > component directory for _both_ the layout and the partial. I don''t > understand why a component would reference a layout from the > application base, if components are supposed to be decoupled enough > to share around between apps. > > My suggestions would be that if you want to surround your component > with a layout, and you want that layout to be based on your base > application (rather than the component), then tell the component to > render without a layout, and instead do that layout stuff in the > thing that calls the component. For example, I load my components > from a controller in my application, which does something like: > > def home_page > @calendar = render_component_as_string(...parameters for > calendar component...) > end > > Thus the template (and layout) for my home_page action get to put > the result of the component (stored in @calendar) wherever they > want, and can surround in with menu''s, other content, more > components or whatever, and the component doesn''t need to know. > > regards, > > Craig > > Brett Walker wrote: > > >> Craig, since you''re using components, maybe you can help me. I >> have a component that I''m rendering with a layout in my layouts >> directory. That layout file is rendering a partial in one of my >> controller directories: >> >> <%= render_partial "admin/admin/signinstatus" %> >> >> Rails seems to want to look under the components directory for >> the partial, instead of app/views, and thus can''t find the partial. >> >> Have you, or anyone else, run into this issue? >> >> Thanks, >> Brett >> > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >