A couple more thoughts. 1. Does your Timesheet class have a name field? It's not strictly required but lots of hobo seems much happier if it is defined -- either as a field or by attaching :name => true to one of your other fields (e.g., title in this case).
2. The most helpful tip Bryan offered me a while back was to jump into the debugger to play around with things and see what's going on internally. One thing you should try is to insert require 'ruby-debug' ; debugger into def index before the call to hobo_index. Take a look at the value of @timesheets and see if it looks like what you would expect. Once you're in the debugger, type set autoeval then you can eval ruby code at the command prompt. Try, e.g., @timesheets.count and @timesheets.*.name for starters. On Jun 23, 4:31 pm, hobo_hippy <[email protected]> wrote: > Thanks btw... still doesn't do anything though, and the export didn't > seem to work either (just gives me a 404 error). If I could get EITHER > of these two things to work, the sort OR the export, I'd be pretty > happy. When I click on a column title, the url adjusts appropriately > to end with sort=whatever_I_Just_Clicked but the table remains > unchanged. It is always sorted by created_at. what's going on?! Also, > I assume navigating to timesheets/export calls the method you defined > as export, so why do I get a 404 when I navigate there? > > I'm still learning a lot, so thanks for helping me so far > > <index-page> > <after-top-page-nav:> > <div class="export-link">%> > <a href="/timesheets/export">Export</a> > </div> > </after-top-page-nav:> > > <collection: replace> > <div id="table-plus"> > <table-plus fields="client, project, user, time, created_at, this"> > <empty-message:><h3>No timesheets to display</h3></empty- > message:> > </table-plus> > </div> > </collection:> > </index-page> > > class TimesheetsController < ApplicationController > > hobo_model_controller > > def index > @timesheets = Timesheet.apply_scopes(:search => [params > [:search], :title], :order_by => parse_sort_param > (:title, :time, :client, :project, :user)) > hobo_index @timesheets > end > > def export > @records = Timesheet.all > if @records.count.zero? > flash[:notice] = "No #{self.model.name.pluralize} to export!" > elsif [email protected]_to?(:to_csv) > flash[:notice] = "Export not supported for # > {self.model.name.pluralize}" > else > send_data @records.to_csv, :type => 'text/csv', :filename => > self.model.name.pluralize + '.csv' > end > end > > auto_actions :all > index_action :export > > end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
