Class: Recruiter::Users::ArticlesController

Inherits:
UserController show all
Defined in:
app/controllers/recruiter/users/articles_controller.rb

Instance Method Summary collapse

Methods inherited from RecruiterController

#page, #per_page

Methods included from CrudFlashMessagerHelper

#crud_flash, #set_crud_error_flash, #set_crud_success_flash

Instance Method Details

#createObject



20
21
22
23
24
# File 'app/controllers/recruiter/users/articles_controller.rb', line 20

def create
  @article = scope.build(article_params)
  crud_flash @article.save
  respond_with(@article)
end

#destroyObject



35
36
37
38
# File 'app/controllers/recruiter/users/articles_controller.rb', line 35

def destroy
  crud_flash @article.destroy
  respond_with(@article)
end

#editObject



26
27
28
# File 'app/controllers/recruiter/users/articles_controller.rb', line 26

def edit
  respond_with(@article)
end

#indexObject



6
7
8
9
# File 'app/controllers/recruiter/users/articles_controller.rb', line 6

def index
  @articles = scope.page(page).per(per_page)
  respond_with(@articles)
end

#newObject



15
16
17
18
# File 'app/controllers/recruiter/users/articles_controller.rb', line 15

def new
  @article = scope.build
  respond_with(@article)
end

#showObject



11
12
13
# File 'app/controllers/recruiter/users/articles_controller.rb', line 11

def show
  respond_with(@article)
end

#updateObject



30
31
32
33
# File 'app/controllers/recruiter/users/articles_controller.rb', line 30

def update
  crud_flash @article.update(article_params)
  respond_with(@article)
end