Created
February 23, 2016 14:28
-
-
Save Frank004/59f9eeaeebd0e5309352 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
def show | |
@accidents = @employee.accidents.paginate(:page => params[:accidents], :per_page => 5) | |
@incidents = @employee.incidents.paginate(:page => params[:incidents], :per_page => 5) | |
@trainings = @employee.trainings.paginate(:page => params[:trainings], :per_page => 5) | |
end |
def method (value) # how can I pass value to :bar. lets say if value = apple. then I get param[:apple]
param[:bar] # what's the correct syntax to do :value and grab the value
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`
def show
@Accidents = my_call(:accicents)
end
def my_call (method)
@employee.send(method).paginate(:page => params[:accidents], :per_page => 5)
end
`