Class: SalariesController
- Inherits:
-
AuthorizedController
- Object
- InheritedResources::Base
- AuthorizedController
- SalariesController
- Defined in:
- app/controllers/salaries_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #new ⇒ Object
- #payslip ⇒ Object
-
#statistics ⇒ Object
Actions =======.
Methods inherited from AuthorizedController
Instance Method Details
#create ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'app/controllers/salaries_controller.rb', line 34 def create @salary = Salary.new(params[:salary]) if @salary.valid? @salary.build_booking end create! end |
#new ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/salaries_controller.rb', line 14 def new # Allow pre-seeding some parameters salary_params = { :employer => current_tenant.company, :state => 'booked', :duration_from => Date.today, :duration_to => Date.today.in(30.days).to_date } # Set default parameters salary_params.merge!(params[:salary]) if params[:salary] @salary = Salary.new(salary_params) # Prebuild an empty attachment instance @salary..build new! end |
#payslip ⇒ Object
43 44 45 |
# File 'app/controllers/salaries_controller.rb', line 43 def payslip show! end |
#statistics ⇒ Object
Actions
10 11 12 |
# File 'app/controllers/salaries_controller.rb', line 10 def statistics index! end |