I'd recommend putting the auto_action / index_action stuff at the top  
(after hobo_model_controller) rather than the bottom.

--Matt Jones

On Jun 23, 2009, at 4:31 PM, hobo_hippy 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to