summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/characters/hearth_controller.rb3
-rw-r--r--app/controllers/characters/item_infixes_controller.rb27
2 files changed, 30 insertions, 0 deletions
diff --git a/app/controllers/characters/hearth_controller.rb b/app/controllers/characters/hearth_controller.rb
index 82f72d6..c525add 100644
--- a/app/controllers/characters/hearth_controller.rb
+++ b/app/controllers/characters/hearth_controller.rb
@@ -7,6 +7,7 @@ class Characters::HearthController < ApplicationController
forge: [],
laboratory: [],
spicebench: [],
+ binding_array: [],
}
Activity.where("gid like ?", "craft_%").each do |activity|
@@ -20,6 +21,8 @@ class Characters::HearthController < ApplicationController
@amenity_activities[:laboratory].push(activity) && next
when "spicebench"
@amenity_activities[:spicebench].push(activity) && next
+ when "binding_array"
+ @amenity_activities[:binding_array].push(activity) && next
else
raise "Invalid amenity gid (#{requirement_data[:gid]}"
end
diff --git a/app/controllers/characters/item_infixes_controller.rb b/app/controllers/characters/item_infixes_controller.rb
new file mode 100644
index 0000000..0b5f1c5
--- /dev/null
+++ b/app/controllers/characters/item_infixes_controller.rb
@@ -0,0 +1,27 @@
+class Characters::ItemInfixesController < ApplicationController
+ def create
+ # TODO: Can this find-by-id happen automagically?
+ @item_infix = current_char.infix(Item.find(params[:item_id]), Skill.find(params[:skill_id]))
+ if @item_infix
+ flash[:notice] = "Infixed #{@item_infix.item.name}."
+ else
+ flash[:alert] = "Failed to infix item."
+ end
+ redirect_to character_skills_path(current_char)
+ end
+
+ def destroy
+ @item_infix = ItemInfix.find(params[:id])
+ if current_char.remove_infix(@item_infix)
+ flash[:notice] = "Removed #{@item_infix.item.name}."
+ else
+ flash[:alert] = "Failed to remove #{@item_infix.item.name}."
+ end
+ redirect_to character_skills_path(current_char)
+ end
+
+ private
+ def item_infix_params
+ params.require(:item_infix).permit(:item_id, :skill_id)
+ end
+end