Hi Ignacio,
Removing the for="Company" did help me to get to more meaningful errors ;-)
Keeping in mind that I am trying to make the leap to being able to
understand Dryml and Rapid,
I believe my original and current problem is that <form> requires a context
of some kind that has an "errors" method.
I don't know how to provide that. In the original posting's error, the
paginating ActiveRecord relation did not have an "errors" method either.
Maybe a dummy class has to be given to the form that has an "errors"
method. Eventually I will probably have a model that has the filter
parameters for the index page so that users can persist their queries
permanently. At this point, I'd just be super glad to see some form fields
so that I can start playing with queries. Here is what I did as a sort of
silly experiment. I understand that Hash does not have a method for
"errors" of course, but that's where I am.
<index-page>
<collection: replace>
<table-plus without-page-nav fields="this, address, city, state, zipcode,
sic, description, actions" without-search-form>
<actions-view:><bootstrap-table-actions/></actions-view:>
</table-plus>
</collection:>
<aside: replace>
<form with="&attributes=Hash.new" action="companies" method="GET">
<label for="search">Filter by Name:</label><input type="text"
name="filter_name" />
<field-list fields="filter_name" >
</field-list>
<div name="action">
<submit label="Filter"></submit>
</div>
</form>
</aside:>
</index-page>
ActionView::Template::Error (undefined method `errors' for {}:Hash):
app/views/companies/index.dryml:30:in `block (5 levels) in render_page'
app/views/companies/index.dryml:24:in `block (4 levels) in render_page'
app/views/companies/index.dryml:24:in `block (3 levels) in render_page'
app/views/companies/index.dryml:22:in `block (2 levels) in render_page'
app/views/taglibs/front_site.dryml:50:in `block in
index_page__for_company'
app/views/taglibs/front_site.dryml:47:in `index_page__for_company'
app/views/companies/index.dryml:2:in `block in render_page'
app/views/companies/index.dryml:1:in `render_page'
app/views/companies/index.dryml:1:in
`_app_views_companies_index_dryml___2205121278841348310_43471540'
On Tuesday, November 18, 2014 5:13:58 AM UTC-7, Ignacio Huerta wrote:
>
> Hi Michael,
>
> - I think "<search-form>" tag has an extra `for="Company"`. I don't
> think this tag is polymorphic, what happens if you just do:
> <def tag="search-form">
> ...
>
> - I'm not sure what the problem might be with the "undefined method
> errors" message. Can you share a bigger piece of the error trace, to see
> if I can take a look at what's causing it? Thanks!
>
> Warm regards,
> Ignacio
> l
> El 18/11/14 a las 03:19, Michael B escribió:
> > Hello,
> >
> > I'd like to have a search form with fields for each column on the index
> > page.
> >
> > I tried to play around with two approaches and got errors.
> >
> > This is the call of the index-page tag for "companies".
> > I have both variants of the call to a form in the code below.
> > When I call my defined <search-form> it raises an exception that there
> > is a missing search_form method. l
> > In the explicit form case, there is an undefined method 'errors'.
> >
> > Any help appreciated!
> > Regards,
> > Michael Bonnet.
> >
> >
> >
> > <index-page>
> >
> > <collection: replace>
> > <table-plus without-page-nav fields="this, address, city, state,
> zipcode, sic, description, actions" without-search-form>
> >
> > <actions-view:><bootstrap-table-actions/></actions-view:>
> >
> > <!-- removes search filter from table-plus -->
> > <search-filter: replace></search-filter:>
> >
> > </table-plus>
> > </collection:>
> >
> >
> > <aside: replace>
> >
> > <!-- calling this there is an exception with missing *"search_form"*
> method -->
> > <search-form/>
> >
> > <!-- calling this there is an undefined method 'errors' for
> #<ActiveRecord::Relation::ActiveRecord_Relation_Company:0x007f7f59992d40>
> -->
> > <form action="companies" method="GET">
> > <label for="search">Search by Name:</label><input type="text"
> name="search_name" />
> > <field-list fields="name" >
> > </field-list>
> > <div name="action">
> > <submit label="Search"></submit>
> > </div>
> > </form>
> > </aside:>
> >
> > </index-page>
> >
> >
> >
> >
> > <def tag="search-form" for="Company">
> >
> > <form merge param="default" action="companies" method="GET">
> > <error-messages param/>
> > <field-list fields="name, address, city, state, zipcode, sic,
> description" param/>
> > <div param="actions">
> > <submit label="Search" param/>
> > </div>
> > </form>
> >
> > </def>
> >
> >
> >
> >
> >
> > --
> > 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] <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > To post to this group, send email to [email protected]
> <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > 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.