Class: Pageflow::EntriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Pageflow::EntriesController
- Includes:
- EntryPasswordProtection, PublicHttpsMode
- Defined in:
- app/controllers/pageflow/entries_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
71 72 73 74 75 76 |
# File 'app/controllers/pageflow/entries_controller.rb', line 71 def edit @entry = DraftEntry.find(params[:id]) (:edit, @entry.to_model) @entry_config = Pageflow.config_for(@entry) end |
#index ⇒ Object
17 18 19 20 21 |
# File 'app/controllers/pageflow/entries_controller.rb', line 17 def index theming = Theming.for_request(request).with_home_url.first! redirect_to(theming.home_url) end |
#page ⇒ Object
53 54 55 56 57 58 |
# File 'app/controllers/pageflow/entries_controller.rb', line 53 def page entry = PublishedEntry.find(params[:id], entry_request_scope) index = params[:page_index].split('-').first.to_i redirect_to(short_entry_path(entry.to_model, :anchor => entry.pages[index].try(:perma_id))) end |
#partials ⇒ Object
60 61 62 63 64 65 66 67 68 69 |
# File 'app/controllers/pageflow/entries_controller.rb', line 60 def partials authenticate_user! @entry = DraftEntry.find(params[:id]) I18n.locale = @entry.locale (:show, @entry.to_model) respond_to do |format| format.html { render :action => 'partials', :layout => false } end end |
#show ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/pageflow/entries_controller.rb', line 23 def show respond_to do |format| format.any(:html, :css) do @entry = PublishedEntry.find(params[:id], entry_request_scope) I18n.locale = @entry.locale if redirect_location = entry_redirect(@entry) return redirect_to(redirect_location, status: :moved_permanently) end return if redirect_according_to_public_https_mode if !request.format.css? check_entry_password_protection(@entry) end if params[:page].present? @entry.share_target = @entry.pages.find_by_perma_id(params[:page]) else @entry.share_target = @entry end end format.json do authenticate_user! @entry = DraftEntry.find(params[:id]) (:show, @entry.to_model) end end end |
#update ⇒ Object
78 79 80 81 82 83 84 85 |
# File 'app/controllers/pageflow/entries_controller.rb', line 78 def update @entry = DraftEntry.find(params[:id]) (:update, @entry.to_model) @entry.(entry_params) head(:no_content) end |