Let me try this again:

Okay, I can't seem to figure this one out.

I am using the table-plus to show a list of stuff as per the agility
demo.

If I do the following everything works peachy, I can return stuff from
the database and it shows up in the bottom of the page quite nicely.

In the controller, I have:

def index
  if params[:report_type]
    case params[:report_type].first
    when "type1"
      @somelist = Model.all
    end
    hobo_ajax_response(@somelist)
  end
end

In the view, I have:

<section class="content-body" if="&logged_in?">
  <form action="reports/index" update="results">
    <table class="field-list">
      <tr>
        <th>Report Type:</th>
        <td><%= select(:report_type, '', ["type1", "type2", "type3"])
%></td>
      </tr>
    </table>
    <submit label="Submit"/>
  </form>
  <div part="results">
    <% if @somelist.nil? %>
    <% else %>
      <table-plus with="&@somelist" fields="field1, field2, etc">
        <empty-message:>No entries match your criteria</empty-
message:>
      </table-plus>
    <% end %>
  </div>
</section>

However, if I replace that line in the controller "@somelist =
Model.all" to "@somelist = Model.all.first.to_a", I get the following
error: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.name_attribute

Any ideas why?

Thanks,
Johannes


On Mar 4, 1:30 am, javexed <[email protected]> wrote:
> Okay, I can't seem to figure this one out.
>
> I am using the table-plus to show a list of stuff as per the agility
> demo.
>
> If I do the following
> In the controller, I have:
>
> def index
>   if params[:report_type]
>     @somelist = Model.all
>     hobo_ajax_response(@somelist)
>
> In the view, I have the <table-plus with="&@somelist" fields="field1,
> field2, etc">
--~--~---------~--~----~------------~-------~--~----~
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