Created
June 1, 2017 19:18
-
-
Save mh-github/65f083297f44af689532ff71a67850f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # controller code | |
| @offers_grid = initialize_grid(Offer.where(employee_id: myself.id), include: [:customer, :employee]) | |
| # view code | |
| <h1>Listing Offers</h1> | |
| <%= grid(@offers_grid) do |g| | |
| g.column name: 'Offer Id', attribute: 'offer_id', filter: false | |
| if @cmd == true | |
| g.column name: 'Sent By', attribute: 'name', assoc: :employee, custom_filter: @offer_senders | |
| end | |
| g.column name: 'Customer', attribute: 'name', assoc: :customer, custom_filter: :auto | |
| g.column name: 'Date', attribute: 'updated_at', filter: false | |
| g.column name: 'Price (INR)', attribute: 'charges', filter: false | |
| g.column do |c| | |
| link_to 'View / Edit', c | |
| end | |
| end -%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment