From contact at robl.me Mon Dec 29 10:51:07 2008 From: contact at robl.me (Rob Lacey) Date: Mon, 29 Dec 2008 15:51:07 +0000 Subject: [Apotomo-talk] Trouble getting started Message-ID: <4958F1EB.2040600@robl.me> Hi there, I've just come across the Apotomo project and it seems like quite an exciting prospect. I'm very keen to give this a try in my new project. I came across a similar R&D framework recently which I have a great deal of trouble with but hopefully this will be more fruitful. I am however getting the following error immediately when I try incorporating the counter example in my existing controller (the project is Rails 2.2.2), am I missing a require somewhere? Shouldn't this be included by default after I've install the plugin and restarted? uninitialized constant Apotomo::ControllerHelper Once I've got this sorted, how would you then incorporate the widget into a normal view, simply by using render_cell(blah, blah)? Many thanks RobL From apotonick at gmail.com Mon Dec 29 13:16:50 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Mon, 29 Dec 2008 19:16:50 +0100 Subject: [Apotomo-talk] Trouble getting started In-Reply-To: <4958F1EB.2040600@robl.me> References: <4958F1EB.2040600@robl.me> Message-ID: hey rob! > I've just come across the Apotomo project and it seems like quite an > exciting prospect. I'm very keen to give this a try in my new project. I > came across a similar R&D framework recently which I have a great deal of > trouble with but hopefully this will be more fruitful. > what's R&D? > I am however getting the following error immediately when I try > incorporating the counter example in my existing controller (the project is > Rails 2.2.2), am I missing a require somewhere? Shouldn't this be included > by default after I've install the plugin and restarted? > > uninitialized constant Apotomo::ControllerHelper > currently you need the engines plugin in Rails to use Apotomo. see http://github.com/apotonick/cells -> Installation -> Engines for directions. you may also join the irc-channel #cells to get my help directly! > Once I've got this sorted, how would you then incorporate the widget into a > normal view, simply by using render_cell(blah, blah)? > #render_cell is for cells, to include widgets in your page you would use #act_as_widget in the controller action. just take the counter example and play around with it. again- join the channel to catch me live. thanks for your interest. cheers, nick > Many thanks > > RobL > > _______________________________________________ > Apotomo-talk mailing list > Apotomo-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/apotomo-talk > From apotonick at gmail.com Mon Dec 29 13:51:45 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Mon, 29 Dec 2008 19:51:45 +0100 Subject: [Apotomo-talk] Trouble getting started In-Reply-To: <495919AB.5070403@robl.me> References: <4958F1EB.2040600@robl.me> <495919AB.5070403@robl.me> Message-ID: On Mon, Dec 29, 2008 at 7:40 PM, Rob Lacey wrote: > Nick Sutterer wrote: >> >> hey rob! >> >> > > Hey Nick, thats for getting back to me so quickly. > >>> I've just come across the Apotomo project and it seems like quite an >>> exciting prospect. I'm very keen to give this a try in my new project. I >>> came across a similar R&D framework recently which I have a great deal of >>> trouble with but hopefully this will be more fruitful. >>> >>> >> >> what's R&D? > > Sorry I meant Research and Development, it was a framework called Brix. I > went for an interview with the company that developed it (PlayLouder) and it > certainly seemed interesting. But they abandoned Rails for their own > framework, which I guess isn't without its problems. No disrespect to > anybody, it seems that Apotomo is a much cleaner solution so far and of > course Rails so alot more familiar to me. > ok, i've heard of Brix, sounded interesting but i never looked closer to it as i like the Rails/Merb frameworks too much. > Thanks for that, I did manage to get the counter example working in the end > by fumbling about, pity I didn't find the part of the docs I was looking for > earlier :S Of course now I want to embed this into one of my existing views > so that I can effectively do parital updates of the page. The render_widget > call is just a controller helper so you have to assign that to an instance > variable and then display that within a view. Is there are reason why its > not a view helper as well? That doesn't really feel right to me actually > although assigning a rendered cell to a variable and then displaying it > seems odd too. I guess this is all new. > you could of course call helper Apotomo::ControllerHelper to make #render_widget in your view callable. be warned that #render_widget just handles, well, rendering. the event processing must be handled seperately. the current Apotomo-version is aimed to run with #act_as_widget only (which does both), but there's an example on http://github.com/apotonick/apotomo_sample_app in the controller. but i can help you with that. > At the moment I render a show page for Artist (I am building a small music > site, and I intend to add for example release information), for now I will > also render the counter as I would a normal cell. When I do that the '--' > and '++' state changes don't go the the correct url, they attempt to access > the current url with the params to update the counter but of course my > 'show' action isn't the widget action and so nothing happens. > see above, that's because you need to activate event processing also in the controller! nick From contact at robl.me Wed Dec 31 07:54:42 2008 From: contact at robl.me (Rob Lacey) Date: Wed, 31 Dec 2008 12:54:42 +0000 Subject: [Apotomo-talk] Namespace clashes and contributing Message-ID: <495B6B92.90701@robl.me> Hi there, After expanding on the basic Counter example I've started playing with grabbing variable numbers of results from my database to try and create a more real life example I can work with. This initially worked late last night and when I came back to it this morning it was unexpectedly broken. It seems my choice of class 'Event' for the app I am building clashes with the Apotomo::Event as it is not explicitly named by its full namespace in two files. After making the following changes my app worked fine again. My question really is can I and how do I commit this back to Apotomo since I guess this problem could re-occur for other people. I'd like to contribute my tuppence worth if it helps. Also when I went to run the test suite from rake test::plugins:all PLUGIN=apotomo It only picked up one file, since only one of the unit tests ends in _test.rb, most of them are test_.rb. Should this be updated? All the best RobL rl at bloodandguts:~/src/bd$ git diff vendor/plugins/apotomo/ diff --git a/vendor/plugins/apotomo/app/helpers/apotomo/controller_helper.rb b/vendor/plugins/apotomo/app/helpers/apotomo/controller_helper.rb index 68bb30f..90c06a2 100644 --- a/vendor/plugins/apotomo/app/helpers/apotomo/controller_helper.rb +++ b/vendor/plugins/apotomo/app/helpers/apotomo/controller_helper.rb @@ -110,7 +110,7 @@ module Apotomo source = tree.find_by_id(params[:source]) - evt = Event.new(params[:type], source.name) # type is :invoke per default. + evt = Apotomo::Event.new(params[:type], source.name) # type is :invoke per default. ### NOTE: this will be removed when the WidgetTree is fully dynamic. if evt.type == :invoke diff --git a/vendor/plugins/apotomo/lib/apotomo/event_aware.rb b/vendor/plugins/apotomo/lib/apotomo/event_aware.rb index ebee772..f987e8c 100644 --- a/vendor/plugins/apotomo/lib/apotomo/event_aware.rb +++ b/vendor/plugins/apotomo/lib/apotomo/event_aware.rb @@ -71,7 +71,7 @@ module Apotomo def trigger(event_type, source_id=self.name) puts "triggered #{event_type.inspect} in #{source_id.inspect}" - event = Event.new + event = Apotomo::Event.new event.type = event_type event.source_id = source_id