Class: Locomotive::ContentEntriesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::ContentEntriesController
show all
- Defined in:
- app/controllers/locomotive/content_entries_controller.rb
Instance Method Summary
collapse
#require_ssl
#current_site_public_url, #public_page_url, #switch_to_site_url
#sections
#back_to_default_site_locale, #current_content_locale, #localized?, #set_back_office_locale, #set_current_content_locale, #setup_i18n_fallbacks
Instance Method Details
#create ⇒ Object
46
47
48
49
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 46
def create
@content_entry = @content_type.entries.create(params[:content_entry])
respond_with @content_entry, location: edit_content_entry_url(@content_type.slug, @content_entry._id)
end
|
#destroy ⇒ Object
67
68
69
70
71
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 67
def destroy
@content_entry = @content_type.entries.find(params[:id])
@content_entry.destroy
respond_with @content_entry, location: content_entries_url(@content_type.slug)
end
|
#edit ⇒ Object
51
52
53
54
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 51
def edit
@content_entry = @content_type.entries.find(params[:id])
respond_with @content_entry
end
|
#export ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 26
def export
@content_entries = @content_type.ordered_entries
respond_with @content_entries, {
filename: @content_type.slug,
col_sep: ';',
content_type: @content_type,
host: request.host_with_port
}
end
|
#index ⇒ Object
20
21
22
23
24
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 20
def index
options = { page: params[:page] || 1, per_page: Locomotive.config.ui[:per_page] }
@content_entries = @content_type.list_or_group_entries(options)
respond_with @content_entries
end
|
#new ⇒ Object
41
42
43
44
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 41
def new
@content_entry = @content_type.entries.build
respond_with @content_entry
end
|
#show ⇒ Object
36
37
38
39
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 36
def show
@content_entry = @content_type.entries.find(params[:id])
respond_with @content_entry
end
|
#sort ⇒ Object
62
63
64
65
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 62
def sort
@content_type.klass_with_custom_fields(:entries).sort_entries!(params[:entries])
respond_with @content_type
end
|
#update ⇒ Object
56
57
58
59
60
|
# File 'app/controllers/locomotive/content_entries_controller.rb', line 56
def update
@content_entry = @content_type.entries.find(params[:id])
@content_entry.update_attributes(params[:content_entry])
respond_with @content_entry, location: edit_content_entry_url(@content_type.slug, @content_entry._id)
end
|