Kevin,

I've been reading and rereading the manual and going over your
recommendations above with no luck. I'm completely stuck and
confused!! please advise. I've included the setup I'm using in a dummy
site I'm messing with to figure this out. Personally, I'm convinced
it's that I'm doing something stupid in setting up the controller.

controller:
____________________________________________
class ThingsController < ApplicationController

  hobo_model_controller

  auto_actions :all

  def show
        @rando = Thing :first, :limit => 1, :offset =>
rand(Thing.count)
  end

end


model:
____________________________________________

class Thing < ActiveRecord::Base

  hobo_model # Don't put anything above this

  fields do
    name        :string
    body        :text
    timestamps
  end


  # --- Permissions --- #

  def create_permitted?
    acting_user.administrator?
  end

  def update_permitted?
    acting_user.administrator?
  end

  def destroy_permitted?
    acting_user.administrator?
  end

  def view_permitted?(field)
    true
  end

end


page defined in application.dryml
____________________________________________

<def tag="index-page" for="Thing">
  <page merge title="#{ht
'things.index.title', :default=>['Things'] }">
    <body: class="index-page thing" param/>

    <content: param>
      <header param="content-header">
        <h2 param="heading">
          <ht key="things.index.heading">
            Things
          </ht>
        </h2>

        <p param="count" if>
          <ht key="things.collection.count" count="&this.size">
            There <count prefix="are"/>
          </ht>
        </p>
      </header>

      <section param="content-body">
        <a action="new" to="&model" param="new-link">
          <ht key="things.actions.new">New Thing</ht>
        </a>

        <page-nav param="top-page-nav"/>

        <collection param/>

        <page-nav param="bottom-page-nav"/>


      </section>

      <section>
        <card with="&@rando"/>
        <view with="&@rando"/>
      </section>

    </content:>
  </page>
</def>



-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to