Hi, You are 120% correct! Currently tables require you to add some fiels like:
<table fields="name"></table> I completely agree that in absence of any fields, it should try to automatically use the fields in the model. That's the Hobo spirit :). I have stumbled against this myself and many other people will certainly have. I'm going to create a bug for this, thanks for the detailed report! Warm regards, Ignacio El 17/08/14 a las #4, JezC escribió: > 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] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/hobousers. > For more options, visit https://groups.google.com/d/optout. -- 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.
