-
Notifications
You must be signed in to change notification settings - Fork 68
Troubleshooting
Your controller should have the line
include Apotomo::ControllerMethods
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
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.
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
- You forgot to add drink to root, so Apotomo knows about it:
use_widgets do |root|
root << drink = section(‘drink’)