Guest User

Untitled

a guest
Jun 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. JOB
  2. > model
  3. has_many :applications
  4. has_many :members, :through => :applications
  5.  
  6. > controller
  7. def apply
  8. @application = Application.new(params[:application])
  9. @application.member = @current_user
  10. @application.job = Job.find(params[:id])
  11.  
  12. if request.post? and @application.save
  13. flash[:notice] = 'Job was applied'
  14. redirect_to :action => 'index'
  15. end
  16. end
Add Comment
Please, Sign In to add comment