Module: ScribbleCms::ScribblerControllerPlugin::InstanceMethods
- Defined in:
- lib/scribble_cms/scribbler_controller_plugin.rb
Instance Method Summary collapse
- #container_add_item ⇒ Object
-
#container_edit ⇒ Object
Containers.
- #container_update ⇒ Object
- #crop_image ⇒ Object
- #group_destroy ⇒ Object
-
#group_edit ⇒ Object
Groups.
- #group_update ⇒ Object
-
#image_cropper ⇒ Object
images.
- #index ⇒ Object
- #picture ⇒ Object
- #search ⇒ Object
Instance Method Details
#container_add_item ⇒ Object
44 45 46 47 48 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 44 def container_add_item @container.get_group("#{@container.id}-#{Time.now.to_i}") flash[:notice] = "Neues Element für #{@container.name} wurde angelegt" redirect_to :back end |
#container_edit ⇒ Object
Containers
34 35 36 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 34 def container_edit render "/scribbler_admin/container_edit" end |
#container_update ⇒ Object
38 39 40 41 42 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 38 def container_update @container.update_attributes(container_params) flash[:notice] = "Container #{@container.name} was saved" redirect_to :action => "index" end |
#crop_image ⇒ Object
80 81 82 83 84 85 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 80 def crop_image @element = ScribblerImage.find(params[:id]) @element.update_attributes(image_params) @element.image.reprocess! redirect_to :action => "group_edit", :id => @element.group_id end |
#group_destroy ⇒ Object
69 70 71 72 73 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 69 def group_destroy @group.destroy flash[:notice] = "Daten wurden gelöscht" redirect_to :action => "index" end |
#group_edit ⇒ Object
Groups
58 59 60 61 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 58 def group_edit @containers = ScribblerContainer.all render "/scribbler_admin/group_edit" end |
#group_update ⇒ Object
63 64 65 66 67 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 63 def group_update @group.process_group_data(params.require(:scribbler_group).permit!) flash[:notice] = "Änderungen wurden gespeichert" redirect_to :back end |
#image_cropper ⇒ Object
images
76 77 78 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 76 def image_cropper @element = ScribblerImage.find(params[:id]) end |
#index ⇒ Object
28 29 30 31 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 28 def index @containers = ScribblerContainer.all render "/scribbler_admin/index" end |
#picture ⇒ Object
88 89 90 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 88 def picture end |
#search ⇒ Object
50 51 52 53 54 |
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 50 def search @containers = ScribblerContainer.all @items = ScribblerText.(params[:scribbler][:query]) render "/scribbler_admin/search" end |