Module: ScribbleCms::ScribblerControllerPlugin::InstanceMethods

Defined in:
lib/scribble_cms/scribbler_controller_plugin.rb

Instance Method Summary collapse

Instance Method Details

#container_add_itemObject



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_editObject

Containers



34
35
36
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 34

def container_edit
  render "/scribbler_admin/container_edit"
end

#container_updateObject



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_imageObject



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_destroyObject



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_editObject

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_updateObject



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 :action => "group_edit", id: @group.id
end

#image_cropperObject

images



76
77
78
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 76

def image_cropper
  @element = ScribblerImage.find(params[:id])
end

#indexObject



28
29
30
31
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 28

def index
  @containers = ScribblerContainer.all
  render "/scribbler_admin/index"
end

#pictureObject



88
89
90
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 88

def picture

end

#searchObject



50
51
52
53
54
# File 'lib/scribble_cms/scribbler_controller_plugin.rb', line 50

def search
  @containers = ScribblerContainer.all
  @items = ScribblerText.find_by_tags(params[:scribbler][:query])
   render "/scribbler_admin/search"
end