I think my expectations may be wrong. But I'm not sure why they should be.

class Thing < ActiveRecord::Base
  hobo_model
  fields do
    name :string
  end
  attr_accessible :name
  set_search_columns: :name
  has_many :stuffs, inverse_of: :thing
  children :stuffs
  ...
end

class Stuff < ActiveRecord::Base
  hobo_model
  fields do
    description :html
  end
  attr_accessible :description
  set_search_column :description
  belongs_to :thing, inverse_of: :stuffs
  ...
end

class ThingsController < ApplicationController
  hobo_model_controller
  include Hobo::Controller::AuthenticationSupport
  before_filter :login_required
  auto_actions :all
end

and then app/views/things/show.dryml:

<show-page>
  <collection: replace>
    <table>
    </table>
  </collection:>
</show-page>

My expectation? That I'd have a searchable collection of Stuffs when I show 
a single Thing. What I get, is a Thing (showing it's name), and a header 
for Stuffs. I don't see any stuffs in a table. If I use "rails c", I can 
get a non-zero count for product(id).stuffs.count. They exist. Why 
shouldn't I have a default table of stuffs, without having to specify 
fields, and using the hints already available, that I want this table to be 
searchable on the Stuff#description?

I think this'd be a good default behaviour, and it would let one use the 
development principle of adding the least amount of code to get a result, 
and then adding code to tune the result.

And this should even more so be the result when using table-plus instead of 
table (since table-plus inherits from table, this should just happen).

At the moment, if I change <table></table> to <table-plus></table-plus>, I 
get an "undefined method 'method_defined?'" error. IMO, it should show a 
default table.

Thoughts? Why *shouldn't* a rapid application generator show something 
usable when the least change is made? Is it possible to make an even 
smaller change in the "show.dryml" code, and have a useful result?

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to