Skip to content
mgrobelin edited this page Sep 14, 2010 · 6 revisions

When I access the page, it’s giving me an error: “uninitialized constant Apotomo::ControllerHelper”

Your controller should have the line

include Apotomo::ControllerMethods

I’m getting a CookieOverflow Exception

Currently Apotomo stores its widgets and internal states in the session. Rails’ default session store is the :cookie_store, which can only handle 4K of session data. Switch to ActiveRecordStore or memcache. In config/environment.rb

action_controller.session_store = :active_record_store

Then, to create the session database, run

rake db:sessions:create

I modified widget code but the changes don’t show up on the page

As widgets are persistent, after changing the widget tree in the controller you have to flush the widgets. Currently this can be done by appending

?reload_tree=1

to the url, than reload. The widgets will setup completely new and your changes should appear on the page.

We’re working on a rake task to flush sessions as users of deployed code shouldn’t be made responsible for keeping their widgets up to date.

I get a RuntimeException Couldn’t render non-existant widget `drink` although my code looks fine.

Whenever changing or appending widgets to the root widget_tree, you need to flush it by passing the “flush_widgets” parameter to your controller:

http://mydomain/mycontroller?flush_widgets=1

Now the widget_tree is purged & reloaded from the session and you’ll be redirected to /mycontroller

use_widgets do |root|
drink = section(‘drink’)
drink << cell(:michal, :sober, ‘drinker’)
drink << cell(:beer, :display, ‘yummy’)
end

render :text => render_widget(‘drink’)
  1. You forgot to add drink to root, so Apotomo knows about it:
    use_widgets do |root|
    root << drink = section(‘drink’)