Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:46:30+00:00 2026-06-09T21:46:30+00:00

I’m trying to build a guestbook module within a Rails site using the Alchemy

  • 0

I’m trying to build a guestbook module within a Rails site using the Alchemy CMS framework. There doesn’t appear to be much in the way of documentation for module building with Alchemy, so I’m just going off of this page.

I’ve created two controllers, one that admins will use called guestbook_controller.rb and placed this under app/controllers/admin

module Admin
  class GuestbookController < Alchemy::Admin::ResourcesController
    def index
      "index"
    end
  end
end

and another for guest to access under app/controllers/guestbook_controller.rb

class GuestbookController < ActionController::Base
  def index
    "index"
  end
end

My intention is that Guestbook posts will be displayed under one of the pages already within Alchemy and a form will also be displayed on this page.

The guestbook model looks this:

class GuestbookEntry < ActiveRecord::Base
  attr_accessible :location, :message, :name
end

My routes file looks like the following:

resources :guestbook

namespace :admin do
  resources :guestbook
end

mount Alchemy::Engine => '/'

and I have a file called authorization_rules.rb under config that looks like:
authorization do

  role :admin do
    has_permission_on :guestbook, :to => [:manage]
  end

end

The first problem that I’m encountering is that going to the route /admin/guestbook gives me the error ‘You are not Authorized’, but the authorization rules file should be being called by my initalizer, so why am I getting this error?

# Registering guestbook module in Alchemy CMS
Alchemy::Modules.register_module(YAML.load_file(File.join(File.dirname(__FILE__), '../..', 'config/guestbook_module.yml')))

# Loading authorization rules and register them to auth engine instance
Alchemy::AuthEngine.get_instance.load(File.join(File.dirname(__FILE__), '../..', 'config/authorization_rules.rb'))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:46:32+00:00Added an answer on June 9, 2026 at 9:46 pm

    The problem with the authorization is easy.
    You just need to write:

    has_permission_on :admin_guestbook, :to => [:manage]
    

    Another thing I noticed: Your frontend GuestbookController should inherit from Alchemy::BaseController.

    And you should make sure that your page you want to render the guestbook entries on, must not be cached by Alchemy. You can do this by using cache: false option in the page_layouts.yml for your page layout.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.