Class: Dhatu::PhotoAlbumsController
Instance Method Summary
collapse
#configure_filter_param_mapping, #get_category_filters
Instance Method Details
#choose_category_type ⇒ Object
6
7
|
# File 'app/controllers/dhatu/photo_albums_controller.rb', line 6
def choose_category_type
end
|
#make_parent ⇒ Object
23
24
25
26
27
28
|
# File 'app/controllers/dhatu/photo_albums_controller.rb', line 23
def make_parent
@photo_album = @r_object = Dhatu::PhotoAlbum.find(params[:id])
@photo_album.update_attribute(:parent_id, nil)
get_collections
render_accordingly
end
|
#mark_as_featured ⇒ Object
30
31
32
33
34
|
# File 'app/controllers/dhatu/photo_albums_controller.rb', line 30
def mark_as_featured
@photo_album = @r_object = Dhatu::PhotoAlbum.find(params[:id])
@photo_album.published?
render_row
end
|
#remove_from_featured ⇒ Object
36
37
38
39
40
|
# File 'app/controllers/dhatu/photo_albums_controller.rb', line 36
def remove_from_featured
@photo_album = @r_object = Dhatu::PhotoAlbum.find(params[:id])
@photo_album.featured?
render_row
end
|
#update_status ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/dhatu/photo_albums_controller.rb', line 9
def update_status
@photo_album = @r_object = Dhatu::PhotoAlbum.find(params[:id])
case params[:status]
when "unpublished"
@photo_album.unpublish!
when "removed"
@photo_album.remove!
when "published"
@photo_album.publish!
end
set_notification(true, I18n.t('status.success'), I18n.t('state.changed', item: default_item_name.titleize, new_state: @r_object.status))
render_row
end
|