From mike.pence at gmail.com Mon Mar 3 22:56:05 2008 From: mike.pence at gmail.com (Mike Pence) Date: Mon, 3 Mar 2008 22:56:05 -0500 Subject: [Cells-talk] A new plugin that does much of what Cells does Message-ID: I have been working with Cells for a few weeks now, with great success. A fellow Rubyist pointed this out to me, http://github.com/sd/embedded-actions/wikis/home. It basically does what Cells does -- in fact, it basically *is* render_component. It has an advantage over Cells -- it does not require a new folder structure for views and controllers. It uses the same controllers/actions/params strategies as regular views, but you can embed views in views with another controller action. Like I said, it is render_component reborn, without requiring the Engines plugin, as Cells does. Check it out. Let me know what you think. Really digging extjs as well, just not quite sure how this all comes together best. I mean, shouldn't the rich UI just be in Javascript, and the Rails back-end provides services to the UI, including maybe some UI metadata? What is the right separation of concerns, if you are not obsessed with avoiding Javascript? Best, Mike Pence From mike.pence at gmail.com Mon Mar 3 23:04:19 2008 From: mike.pence at gmail.com (Mike Pence) Date: Mon, 3 Mar 2008 23:04:19 -0500 Subject: [Cells-talk] Cells can't use Ajax helpers Message-ID: BTW, I was not working with trunk, I think it was 1.0, but I discovered that Cells cannot use link_to_remote and other Ajax helpers because Rails embeds some kind of security token with those Ajax requests, unless you write them directly as JavaScript. We should fix that one. Also, I found that if the last line of a controller/state evaluates to a string, the mini-controller renders that string and does not render the rhtml for the cell. Best, Mike Pence From Peter.Bex at solide-ict.nl Tue Mar 4 03:42:59 2008 From: Peter.Bex at solide-ict.nl (Peter Bex) Date: Tue, 4 Mar 2008 09:42:59 +0100 Subject: [Cells-talk] A new plugin that does much of what Cells does In-Reply-To: References: Message-ID: <20080304084259.GA761@darko.solide-ict.nl> On Mon, Mar 03, 2008 at 10:56:05PM -0500, Mike Pence wrote: > I have been working with Cells for a few weeks now, with great > success. A fellow Rubyist pointed this out to me, > http://github.com/sd/embedded-actions/wikis/home. It basically does > what Cells does -- in fact, it basically *is* render_component. It has > an advantage over Cells -- it does not require a new folder structure > for views and controllers. It uses the same controllers/actions/params > strategies as regular views, but you can embed views in views with > another controller action. Like I said, it is render_component reborn, > without requiring the Engines plugin, as Cells does. It looks really clean and simple, I like it! On the other hand, one disadvantage is that it wants you to pollute your controller's namespace with actions that are _only_ embedded. So you end up with pretty big controllers. Also, last time I checked making controller class hierarchies is pretty broken in Rails (but that can be fixed with some hacking). I bet that embedded-actions work better with existing tools which already know about controllers. With Cells you'd somehow have to teach those tools about cells, which can be a pain. > Check it out. Let me know what you think. Really digging extjs as > well, just not quite sure how this all comes together best. I mean, > shouldn't the rich UI just be in Javascript, and the Rails back-end > provides services to the UI, including maybe some UI metadata? What is > the right separation of concerns, if you are not obsessed with > avoiding Javascript? What I prefer is to do everything via Ajax, putting as little knowledge in the JS as possible (otherwise you often end up duplicating knowledge in both Javascript and Rails). It depends on the project if this is feasible. Have a look at http://formbuilder.rubyforge.org, that's my first Cells project I uploaded recently, there I do almost everything in Rails, via Ajax. Cheers, Peter Bex Solide ICT - http://www.solide-ict.nl From Peter.Bex at solide-ict.nl Tue Mar 4 04:31:25 2008 From: Peter.Bex at solide-ict.nl (Peter Bex) Date: Tue, 4 Mar 2008 10:31:25 +0100 Subject: [Cells-talk] Cells can't use Ajax helpers In-Reply-To: References: Message-ID: <20080304093125.GB761@darko.solide-ict.nl> On Mon, Mar 03, 2008 at 11:04:19PM -0500, Mike Pence wrote: > BTW, I was not working with trunk, I think it was 1.0, but I > discovered that Cells cannot use link_to_remote and other Ajax helpers > because Rails embeds some kind of security token with those Ajax > requests, unless you write them directly as JavaScript. We should fix > that one. I personally heavily dislike RJS and its very principle (hiding JS because Ruby is *a so much nicer language* - *cough*), and RJS is a bit crippled in what you can do with it so I often end up injecting straight JS into my code, which is even uglier. Long story short, I don't use these helper things too often so maybe Nick or you can have a look at it? > Also, I found that if the last line of a controller/state evaluates to > a string, the mini-controller renders that string and does not render > the rhtml for the cell. That's a feature, not a bug. In many cases you have very simple views which don't require a full template. In those cases the overhead of generating the template can be undesirable. Just put a 'nil' statement at the end of your method if you end up with some string value but want to render a template. Cheers, Peter Bex Solide ICT - http://www.solide-ict.nl From apotonick at gmail.com Tue Mar 4 08:21:18 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Tue, 4 Mar 2008 14:21:18 +0100 Subject: [Cells-talk] Cells can't use Ajax helpers In-Reply-To: References: Message-ID: hey mike! On Tue, Mar 4, 2008 at 5:04 AM, Mike Pence wrote: > BTW, I was not working with trunk, I think it was 1.0, but I > discovered that Cells cannot use link_to_remote and other Ajax helpers > because Rails embeds some kind of security token with those Ajax > requests, unless you write them directly as JavaScript. We should fix > that one. > this sounds strange to me, since i use ajax helper methods everywhere in my cell views. maybe you need to include the prototype helper in your cell? i will look this up when i'm at home, but i guess you forgot to include the correct helper?! > Also, I found that if the last line of a controller/state evaluates to > a string, the mini-controller renders that string and does not render > the rhtml for the cell. > yeah, that's the intended behaviour for cell state methods (note to myself: update documentation ;-). this really makes sense if you just want to implement a small view or test a workflow or so. i hope this helps! nick ah, i will look at the embedded actions later. this sounds quite interesting and shows me that there are many other coders out there who share problems and solutions with us ;-) From mike.pence at gmail.com Sun Mar 16 12:07:52 2008 From: mike.pence at gmail.com (Mike Pence) Date: Sun, 16 Mar 2008 12:07:52 -0400 Subject: [Cells-talk] My Cells blog post Message-ID: Feedback welcome: http://mikepence.wordpress.com/2008/03/16/cells-bring-clean-re-use-to-your-rails-views/ Best, Mike Pence From mike.pence at gmail.com Mon Mar 17 10:10:07 2008 From: mike.pence at gmail.com (Mike Pence) Date: Mon, 17 Mar 2008 10:10:07 -0400 Subject: [Cells-talk] Cells is a hit! Message-ID: Regarding: http://mikepence.wordpress.com/2008/03/16/cells-bring-clean-re-use-to-your-rails-views/ Over 1,000 page views in the last 24 hours -- on a Sunday! -- and I am expecting thousands more interested readers this week. The article is at the top of ruby.reddit.com and near the top of ycombinator news (http://news.ycombinator.com/). Let's make sure that we have that Ajax helpers issue nailed. :) I have (finally) gotten Netbeans with breakpoint/stepping debugging working, so I am hoping to help out at a code level soon myself. Great work, guys! Best, Mike Pence From bjohnson at lacedlogic.com Wed Mar 19 12:39:08 2008 From: bjohnson at lacedlogic.com (Ben Johnson) Date: Wed, 19 Mar 2008 12:39:08 -0400 Subject: [Cells-talk] Sending requests to cells... Message-ID: <4749059D-CDEC-4994-9727-9A71E399128D@lacedlogic.com> If I have a cell the contains a registration form for users. As the user enters their username I want to send an AJAX request out to make sure it is not taken. How do I get that AJAX request to go to a method contained in the same cell? This way I don't have to include a "check_username" method everywhere I use the cell. Thanks for your help! Thank You, Ben Johnson bjohnson at lacedlogic.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cells-talk/attachments/20080319/fc4b4f57/attachment.html From mike.pence at gmail.com Wed Mar 19 13:59:54 2008 From: mike.pence at gmail.com (Mike Pence) Date: Wed, 19 Mar 2008 13:59:54 -0400 Subject: [Cells-talk] Sending requests to cells... In-Reply-To: <4749059D-CDEC-4994-9727-9A71E399128D@lacedlogic.com> References: <4749059D-CDEC-4994-9727-9A71E399128D@lacedlogic.com> Message-ID: You would write a Rails controller whose sole purpose is to route such requests to the Cell. Kind of your own event dispatcher, if you know what I mean. Do you follow? On Wed, Mar 19, 2008 at 12:39 PM, Ben Johnson wrote: > If I have a cell the contains a registration form for users. As the user > enters their username I want to send an AJAX request out to make sure it is > not taken. How do I get that AJAX request to go to a method contained in the > same cell? This way I don't have to include a "check_username" method > everywhere I use the cell. > > Thanks for your help! > > > > > Thank You, > Ben Johnson > bjohnson at lacedlogic.com > > > > > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > > From mike.pence at gmail.com Wed Mar 19 14:41:48 2008 From: mike.pence at gmail.com (Mike Pence) Date: Wed, 19 Mar 2008 14:41:48 -0400 Subject: [Cells-talk] Cells on the Rails Envy podcast Message-ID: Give it a listen -- just a few minutes in: http://railsenvy.com/2008/3/19/rails-envy-podcast-episode-023-03-19-2008 From apotonick at gmail.com Thu Mar 20 05:45:59 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Thu, 20 Mar 2008 10:45:59 +0100 Subject: [Cells-talk] Sending requests to cells... In-Reply-To: References: <4749059D-CDEC-4994-9727-9A71E399128D@lacedlogic.com> Message-ID: On Wed, Mar 19, 2008 at 6:59 PM, Mike Pence wrote: > You would write a Rails controller whose sole purpose is to route such > requests to the Cell. Kind of your own event dispatcher, if you know > what I mean. Do you follow? > > > > On Wed, Mar 19, 2008 at 12:39 PM, Ben Johnson wrote: > > If I have a cell the contains a registration form for users. As the user > > enters their username I want to send an AJAX request out to make sure it is > > not taken. How do I get that AJAX request to go to a method contained in the > > same cell? This way I don't have to include a "check_username" method > > everywhere I use the cell. > > an example: your registration form cell has two states ("method with view"): #show_form #check_form_input the controller action which renders the cell should be somethink like state = params[:next_state] || :show_form render_cell(:registration_form, state) the form in #show_form sends the input to this controller action, along with some state information like next_state=check_form_input. this way, you access your controller action twice, but it will do different things due to the render_cell call. of course the routing is very insecure, some user could invoke any state on the cell ("### FIXME"). i'm working on some abstract way for problems like that, more on that in a few weeks. cheers, nick > > Thanks for your help! > > > > > > > > > > Thank You, > > Ben Johnson > > bjohnson at lacedlogic.com > > > > > > > > > > > > _______________________________________________ > > Cells-talk mailing list > > Cells-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/cells-talk > > > > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > From mike.pence at gmail.com Thu Mar 20 08:49:41 2008 From: mike.pence at gmail.com (Mike Pence) Date: Thu, 20 Mar 2008 08:49:41 -0400 Subject: [Cells-talk] Sending requests to cells... In-Reply-To: References: <4749059D-CDEC-4994-9727-9A71E399128D@lacedlogic.com> Message-ID: This functionality could re-use the forgery prevention already built into ActionView... On Thu, Mar 20, 2008 at 5:45 AM, Nick Sutterer wrote: > On Wed, Mar 19, 2008 at 6:59 PM, Mike Pence wrote: > > You would write a Rails controller whose sole purpose is to route such > > requests to the Cell. Kind of your own event dispatcher, if you know > > what I mean. Do you follow? > > > > > > > > On Wed, Mar 19, 2008 at 12:39 PM, Ben Johnson wrote: > > > If I have a cell the contains a registration form for users. As the user > > > enters their username I want to send an AJAX request out to make sure it is > > > not taken. How do I get that AJAX request to go to a method contained in the > > > same cell? This way I don't have to include a "check_username" method > > > everywhere I use the cell. > > > > an example: > your registration form cell has two states ("method with view"): > #show_form > #check_form_input > > the controller action which renders the cell should be somethink like > state = params[:next_state] || :show_form > render_cell(:registration_form, state) > > the form in #show_form sends the input to this controller action, > along with some state information like next_state=check_form_input. > this way, you access your controller action twice, but it will do > different things due to the render_cell call. > of course the routing is very insecure, some user could invoke any > state on the cell ("### FIXME"). > > i'm working on some abstract way for problems like that, more on that > in a few weeks. > > > cheers, > > > nick > > > > > > > > Thanks for your help! > > > > > > > > > > > > > > > Thank You, > > > Ben Johnson > > > bjohnson at lacedlogic.com > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Cells-talk mailing list > > > Cells-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/cells-talk > > > > > > > > _______________________________________________ > > Cells-talk mailing list > > Cells-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/cells-talk > > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > From mike.pence at gmail.com Sat Mar 22 13:11:41 2008 From: mike.pence at gmail.com (Mike Pence) Date: Sat, 22 Mar 2008 13:11:41 -0400 Subject: [Cells-talk] Removing the dependency on Engines Message-ID: To remove the dependency on Engines, do the following: action_view_extensions.rb line 89 remove this block: Rails.plugins.by_precedence do |plugin| plugin_specific_path = File.join(plugin.root, 'app', 'cells', template_path.to_s + '.' + extension.to_s) return plugin_specific_path if File.exist?(plugin_specific_path) end action_view_extensions.rb, line 76 replace this: if Engines.disable_application_view_loading path_in_app_directory = nil else path_in_app_directory = File.join(RAILS_ROOT, 'app', 'cells', template_path.to_s + '.' + extension.to_s) end with this: path_in_app_directory = File.join(RAILS_ROOT, 'app', 'cells', template_path.to_s + '.' + extension.to_s) Also, remove line 40 of init.rb, which reads: Engines.mix_code_from :cells That is it! Could someone make and commit this change -- and run the tests, I assume -- while I await svn repository access? Thanks, Mike From mike.pence at gmail.com Sat Mar 22 13:36:06 2008 From: mike.pence at gmail.com (Mike Pence) Date: Sat, 22 Mar 2008 13:36:06 -0400 Subject: [Cells-talk] Removing the dependency on Engines In-Reply-To: References: Message-ID: I have documented this here: http://mikepence.wordpress.com/2008/03/22/removing-the-engines-dependency-from-cells/ On Sat, Mar 22, 2008 at 1:11 PM, Mike Pence wrote: > To remove the dependency on Engines, do the following: > > > action_view_extensions.rb line 89 > > remove this block: > > Rails.plugins.by_precedence do |plugin| > plugin_specific_path = File.join(plugin.root, 'app', 'cells', > template_path.to_s + '.' + > extension.to_s) > return plugin_specific_path if File.exist?(plugin_specific_path) > end > > action_view_extensions.rb, line 76 > > replace this: > > if Engines.disable_application_view_loading > path_in_app_directory = nil > else > path_in_app_directory = File.join(RAILS_ROOT, 'app', 'cells', > template_path.to_s + '.' + extension.to_s) > end > > with this: > > path_in_app_directory = File.join(RAILS_ROOT, 'app', 'cells', > template_path.to_s + '.' + extension.to_s) > > Also, remove line 40 of init.rb, which reads: > > Engines.mix_code_from :cells > > That is it! > > Could someone make and commit this change -- and run the tests, I > assume -- while I await svn repository access? > > Thanks, > Mike > From mike.pence at gmail.com Sat Mar 22 18:12:33 2008 From: mike.pence at gmail.com (Mike Pence) Date: Sat, 22 Mar 2008 18:12:33 -0400 Subject: [Cells-talk] Ajax Helpers, Rails 2 and Cells Message-ID: So, with Rails 2, a method call is mixed-in with ActionController called protect_against_forgery?, which is explained in action_controller/request_forgery_protection.rb. The problem is that the inclusion of an Ajax helper in a Cell, like link_to_remote, results in an attempt to call this function, which fails. I am trying to track this down in terms of which class is required to have this method. Any help appreciated. I will post when I find the solution. Best, Mike Pence From Peter.Bex at solide-ict.nl Tue Mar 25 04:49:15 2008 From: Peter.Bex at solide-ict.nl (Peter Bex) Date: Tue, 25 Mar 2008 09:49:15 +0100 Subject: [Cells-talk] Removing the dependency on Engines In-Reply-To: References: Message-ID: <20080325084915.GA457@darko.solide-ict.nl> On Sat, Mar 22, 2008 at 01:11:41PM -0400, Mike Pence wrote: > Could someone make and commit this change -- and run the tests, I > assume -- while I await svn repository access? Thanks for the patch, Mike! However, Engines support is something I desperately need and it is a good thing, so I haven't completely removed it, but made it *optional*. Could you have a look at the latest trunk (revision 42) and see if that works for you? Cheers, Peter Bex Solide ICT - http://www.solide-ict.nl From mike.pence at gmail.com Tue Mar 25 09:41:42 2008 From: mike.pence at gmail.com (Mike Pence) Date: Tue, 25 Mar 2008 09:41:42 -0400 Subject: [Cells-talk] Removing the dependency on Engines In-Reply-To: <20080325084915.GA457@darko.solide-ict.nl> References: <20080325084915.GA457@darko.solide-ict.nl> Message-ID: Works perfectly. Thanks, Peter! On Tue, Mar 25, 2008 at 4:49 AM, Peter Bex wrote: > On Sat, Mar 22, 2008 at 01:11:41PM -0400, Mike Pence wrote: > > Could someone make and commit this change -- and run the tests, I > > assume -- while I await svn repository access? > > Thanks for the patch, Mike! However, Engines support is something > I desperately need and it is a good thing, so I haven't completely > removed it, but made it *optional*. Could you have a look at the > latest trunk (revision 42) and see if that works for you? > > Cheers, > Peter Bex > Solide ICT - http://www.solide-ict.nl > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > From thomas_hanley at intuit.com Tue Mar 25 11:57:01 2008 From: thomas_hanley at intuit.com (Tom Hanley) Date: Tue, 25 Mar 2008 08:57:01 -0700 Subject: [Cells-talk] Multi-tenant Message-ID: I am looking at options for porting an existing Rails app to a Multi-tenant system. I heard about Cells from a feed, it is unclear to me but is Cells for setting up Multi-tenants? Thanks. Tom From mike.pence at gmail.com Tue Mar 25 12:18:48 2008 From: mike.pence at gmail.com (Mike Pence) Date: Tue, 25 Mar 2008 12:18:48 -0400 Subject: [Cells-talk] Multi-tenant In-Reply-To: References: Message-ID: Tom, What is a "Multi-tenant"? On Tue, Mar 25, 2008 at 11:57 AM, Tom Hanley wrote: > I am looking at options for porting an existing Rails app to a Multi-tenant > system. I heard about Cells from a feed, it is unclear to me but is Cells > for setting up Multi-tenants? > > Thanks. > > Tom > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > From thomas_hanley at intuit.com Tue Mar 25 12:26:20 2008 From: thomas_hanley at intuit.com (Tom Hanley) Date: Tue, 25 Mar 2008 09:26:20 -0700 Subject: [Cells-talk] Multi-tenant In-Reply-To: Message-ID: Essentially I want the same application running for N business units or product. We?d have something like: http://bizunit1.something.com/controller/action http://bizunit2.something.com/controller/action http://bizunit3.something.com/controller/action http://product3.something.com/controller/action In the application I?d pluck out the bizunit1 and set it as a param for the current instance of the application. Then serve views and styles specific to that business unit but keep the heart of the application (Controller/Model) untouched. Basically I don?t want to maintain multiple versions of the same application for each business unit or product. I have looked at using a theme engine to handle this, or even just creating xml and have separate xsl/xslt for each ?site? I guess I am just not clear as to what Cells is. Thanks, Tom On 3/25/08 9:18 AM, "Mike Pence" wrote: > Tom, > > What is a "Multi-tenant"? > > > On Tue, Mar 25, 2008 at 11:57 AM, Tom Hanley wrote: >> I am looking at options for porting an existing Rails app to a Multi-tenant >> system. I heard about Cells from a feed, it is unclear to me but is Cells >> for setting up Multi-tenants? >> >> Thanks. >> >> Tom >> >> _______________________________________________ >> Cells-talk mailing list >> Cells-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/cells-talk >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cells-talk/attachments/20080325/9b35844b/attachment.html From apotonick at gmail.com Tue Mar 25 12:42:12 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Tue, 25 Mar 2008 17:42:12 +0100 Subject: [Cells-talk] Multi-tenant In-Reply-To: References: Message-ID: hey tom, i didn't dare to ask what "multi-tenant" is ;-) cells is an extension of the controller/view layer. you can write controller-like cell classes with methods and associated views and thus plug together your application using multiple cells per application state ("request"), not just one controller action. your "multi-tenant" project sounds as if it really could use cells. apart from encapsulating your code into independent components, these components ("cells") can INHERIT views from super-cells. this is interesting for you. you could design cells for the "main" application and then derive these cells as needed for your architecture. this way you could introduce something like themes. hope this helps! cheers, nick On Tue, Mar 25, 2008 at 5:26 PM, Tom Hanley wrote: > > Essentially I want the same application running for N business units or > product. > > We'd have something like: > http://bizunit1.something.com/controller/action > http://bizunit2.something.com/controller/action > http://bizunit3.something.com/controller/action > http://product3.something.com/controller/action > > In the application I'd pluck out the bizunit1 and set it as a param for the > current instance of the application. Then serve views and styles specific to > that business unit but keep the heart of the application (Controller/Model) > untouched. > > Basically I don't want to maintain multiple versions of the same > application for each business unit or product. > > I have looked at using a theme engine to handle this, or even just creating > xml and have separate xsl/xslt for each "site" > > I guess I am just not clear as to what Cells is. > > Thanks, > Tom > > > On 3/25/08 9:18 AM, "Mike Pence" wrote: > > > Tom, > > > > What is a "Multi-tenant"? > > > > > > > > On Tue, Mar 25, 2008 at 11:57 AM, Tom Hanley > wrote: > > > >> I am looking at options for porting an existing Rails app to a > Multi-tenant > >> system. I heard about Cells from a feed, it is unclear to me but is > Cells > >> for setting up Multi-tenants? > >> > >> Thanks. > >> > >> Tom > >> > >> _______________________________________________ > >> Cells-talk mailing list > >> Cells-talk at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/cells-talk > >> > > > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > > From thomas_hanley at intuit.com Tue Mar 25 12:47:21 2008 From: thomas_hanley at intuit.com (Tom Hanley) Date: Tue, 25 Mar 2008 09:47:21 -0700 Subject: [Cells-talk] Multi-tenant In-Reply-To: Message-ID: Heh, I proposed the idea and our staff engineer said, "You mean Multitenancy..." so the first I had heard the term was yesterday. http://en.wikipedia.org/wiki/Multitenancy I am still in design phase right now but I'll see if Cells is a thing we can incorporate. Thanks, Tom On 3/25/08 9:42 AM, "Nick Sutterer" wrote: > hey tom, > > i didn't dare to ask what "multi-tenant" is ;-) > > cells is an extension of the controller/view layer. you can write > controller-like cell classes with methods and associated views and > thus plug together your application using multiple cells per > application state ("request"), not just one controller action. > your "multi-tenant" project sounds as if it really could use cells. > apart from encapsulating your code into independent components, these > components ("cells") can INHERIT views from super-cells. this is > interesting for you. you could design cells for the "main" application > and then derive these cells as needed for your architecture. this way > you could introduce something like themes. > > hope this helps! > > cheers, > nick > > > On Tue, Mar 25, 2008 at 5:26 PM, Tom Hanley wrote: >> >> Essentially I want the same application running for N business units or >> product. >> >> We'd have something like: >> http://bizunit1.something.com/controller/action >> http://bizunit2.something.com/controller/action >> http://bizunit3.something.com/controller/action >> http://product3.something.com/controller/action >> >> In the application I'd pluck out the bizunit1 and set it as a param for the >> current instance of the application. Then serve views and styles specific to >> that business unit but keep the heart of the application (Controller/Model) >> untouched. >> >> Basically I don't want to maintain multiple versions of the same >> application for each business unit or product. >> >> I have looked at using a theme engine to handle this, or even just creating >> xml and have separate xsl/xslt for each "site" >> >> I guess I am just not clear as to what Cells is. >> >> Thanks, >> Tom >> >> >> On 3/25/08 9:18 AM, "Mike Pence" wrote: >> >>> Tom, >>> >>> What is a "Multi-tenant"? >> >> >>> >>> >>> On Tue, Mar 25, 2008 at 11:57 AM, Tom Hanley >> wrote: >> >> >>>> I am looking at options for porting an existing Rails app to a >> Multi-tenant >>>> system. I heard about Cells from a feed, it is unclear to me but is >> Cells >>>> for setting up Multi-tenants? >>>> >>>> Thanks. >>>> >>>> Tom >>>> >>>> _______________________________________________ >>>> Cells-talk mailing list >>>> Cells-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/cells-talk >>>> >>> >> >> _______________________________________________ >> Cells-talk mailing list >> Cells-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/cells-talk >> >> > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > From mike.pence at gmail.com Wed Mar 26 19:48:56 2008 From: mike.pence at gmail.com (Mike Pence) Date: Wed, 26 Mar 2008 19:48:56 -0400 Subject: [Cells-talk] Latest commit breaks Cells on Rails 2.0 without Engines Message-ID: Hey guys, A blog reader reported that there is a problem with the latest Cells, following the instructions here... http://mikepence.wordpress.com/2008/03/16/cells-bring-clean-re-use-to-your-rails-views/ ...with Rails 2.0. Here is the stack trace from the error: NameError in Host#index Showing app/views/host/index.rhtml where line #1 raised: undefined local variable or method `logger' for FirstCell:Class Extracted source (around line #1): 1: <%= render_cell "first", "index" %> RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace /home/mikepence/work/RailsApplication1/vendor/rails/actionpack/lib/action_controller/helpers.rb:114:in `default_helper_module!' /home/mikepence/work/RailsApplication1/vendor/rails/actionpack/lib/action_controller/helpers.rb:124:in `send' /home/mikepence/work/RailsApplication1/vendor/rails/actionpack/lib/action_controller/helpers.rb:124:in `inherited' #{RAILS_ROOT}/app/cells/first_cell.rb:1 /home/mikepence/work/RailsApplication1/app/views/host/index.rhtml:1:in `_run_rhtml_47app47views47host47index46rhtml' /var/lib/gems/1.8/bin/rdebug-ide:16:in `load' /var/lib/gems/1.8/bin/rdebug-ide:16 I am looking into it, but have limited time over the next day or so. If anyone else can nail it down, that would be good. Best, Mike Pence From Peter.Bex at solide-ict.nl Thu Mar 27 04:21:26 2008 From: Peter.Bex at solide-ict.nl (Peter Bex) Date: Thu, 27 Mar 2008 09:21:26 +0100 Subject: [Cells-talk] Latest commit breaks Cells on Rails 2.0 without Engines In-Reply-To: References: Message-ID: <20080327082126.GB1394@darko.solide-ict.nl> On Wed, Mar 26, 2008 at 07:48:56PM -0400, Mike Pence wrote: > Hey guys, > > A blog reader reported that there is a problem with the latest Cells, > following the instructions here... > > http://mikepence.wordpress.com/2008/03/16/cells-bring-clean-re-use-to-your-rails-views/ > > ...with Rails 2.0. I just helped someone on IRC with this exact same error. The logger object isn't available from Cells and that throws an error. But the logger object is only used itself in case of an error (just open that actionpack file on the line from the stack trace), namely if some helper is not found. Apparently installing Engines fixes this, since Engines does its own helper finding. This was a workaround for this person, but people who really can't use Engines for some reason aren't helped by this, of course. This was with Rails 1.2, so I had actually hoped that this problem would be gone with Rails 2 since your Engines-removal patch worked for you. I suppose there's still something missing. Sorry, no idea how to fix (don't really have the time right now to find out either). Cheers, Peter Bex Solide ICT - http://www.solide-ict.nl From apotonick at gmail.com Thu Mar 27 07:18:47 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Thu, 27 Mar 2008 12:18:47 +0100 Subject: [Cells-talk] Latest commit breaks Cells on Rails 2.0 without Engines In-Reply-To: <20080327082126.GB1394@darko.solide-ict.nl> References: <20080327082126.GB1394@darko.solide-ict.nl> Message-ID: why not provide a method #logger in Cell::Base, which itself accesses @controller which itself provides this logger? nick On Thu, Mar 27, 2008 at 9:21 AM, Peter Bex wrote: > On Wed, Mar 26, 2008 at 07:48:56PM -0400, Mike Pence wrote: > > Hey guys, > > > > A blog reader reported that there is a problem with the latest Cells, > > following the instructions here... > > > > http://mikepence.wordpress.com/2008/03/16/cells-bring-clean-re-use-to-your-rails-views/ > > > > ...with Rails 2.0. > > I just helped someone on IRC with this exact same error. The logger object > isn't available from Cells and that throws an error. But the logger > object is only used itself in case of an error (just open that actionpack > file on the line from the stack trace), namely if some helper is not found. > > Apparently installing Engines fixes this, since Engines does its own helper > finding. This was a workaround for this person, but people who really can't > use Engines for some reason aren't helped by this, of course. > > This was with Rails 1.2, so I had actually hoped that this problem would > be gone with Rails 2 since your Engines-removal patch worked for you. > I suppose there's still something missing. > > Sorry, no idea how to fix (don't really have the time right now to find > out either). > > Cheers, > Peter Bex > Solide ICT - http://www.solide-ict.nl > > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > From Peter.Bex at solide-ict.nl Thu Mar 27 07:44:55 2008 From: Peter.Bex at solide-ict.nl (Peter Bex) Date: Thu, 27 Mar 2008 12:44:55 +0100 Subject: [Cells-talk] Latest commit breaks Cells on Rails 2.0 without Engines In-Reply-To: References: <20080327082126.GB1394@darko.solide-ict.nl> Message-ID: <20080327114455.GC1394@darko.solide-ict.nl> On Thu, Mar 27, 2008 at 12:18:47PM +0100, Nick Sutterer wrote: > why not provide a method #logger in Cell::Base, which itself accesses > @controller which itself provides this logger? Because this happens when the class is loaded, not when it is instantiated. Hence, an instance method is of no use here. Cheers, Peter Bex Solide ICT - http://www.solide-ict.nl