DigitPaint / skyline

The new Ruby on Rails open source standard in content management
http://www.skylinecms.nl
GNU Lesser General Public License v3.0
122 stars 13 forks source link

Admin > Settings gives no method error for page_names on nilClass #1

Closed peterberkenbosch closed 12 years ago

peterberkenbosch commented 14 years ago

Using the gem, version 3.0.8, when I'm in the backend and I select "Settings" from the admin menu I get the following error:

Processing Skyline::SettingsController#index (for 127.0.0.1 at 2009-12-31 10:29:39) [GET] Skyline::User Load (12.8ms) SELECT * FROM "skyline_users" WHERE ("skyline_users"."id" = 1) ORDER BY email ASC LIMIT 1 Skyline::Right Load (4.9ms) SELECT DISTINCT r.* FROM skyline_rights AS r, skyline_grants AS g JOIN skyline_rights_skyline_roles AS rr ON rr.role_id = g.role_id WHERE g.user_id = 1 AND r.id = rr.right_id

NoMethodError (undefined method page_names' for nil:NilClass): skylinecms (3.0.8) app/controllers/skyline/settings_controller.rb:10:inindex' skylinecms (3.0.8) app/controllers/skyline/application_controller.rb:189:in perform_action' skylinecms (3.0.8) lib/./app/middleware/skyline/sprockets_middleware.rb:60:incall' skylinecms (3.0.8) lib/./app/middleware/skyline/flash_session_cookie_middleware.rb:14:in `call'

Rendered rescues/_trace (188.6ms) Rendered rescues/_request_and_response (0.3ms) Rendering rescues/layout (internal_server_error)

DigitPaint commented 14 years ago

If I'm not mistaken this error is thrown when there aren't any Settings defined yet. Can you please check if that is the case by following the the guide at http://www.skylinecms.nl/documentation/guides/how_to_create_content_elements starting from "settings.rb" (near the bottom). If this helps please let us know so we can fix Skyline so a nice message is displayed instead of this error.

-Ronald

peterberkenbosch commented 14 years ago

I will give it a try today... I'll let you know if it worked!

peterberkenbosch commented 14 years ago

I've added the Settings model (is kinda strange name, was expecting a Setting model) But there is no route defined for the settings url, the url needs a settings id to edit, but since I only have a settings model I was expecting to see a page here with a list of indexed and the ability to create a setting.

DigitPaint commented 14 years ago

Settings are meant as a shortcut for things that need to be configured by a CMS user/admin. We mostly use it to let a user choose the 404 page, and link pages to Content items. (See http://github.com/DigitPaint/skyline_demo_site/blob/2ab8bfe3404552ea5e441462592b075e29576a64/app/models/settings.rb for an example of a settings.rb file).

We know the Settings are kind of strange at the moment. We're planning to replace them with a better alternative in one of the coming releases.

peterberkenbosch commented 14 years ago

ok.. I will take a look... thanks

flurin commented 12 years ago

Settings aren't shown if they aren't around.