Skip to content

Commit 4c75642

Browse files
committed
add quick order screen on koelkast
1 parent e5da1e6 commit 4c75642

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

app/controllers/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def quick_order
130130
end
131131

132132
respond_to do |format|
133-
format.html { redirect_back_or_to(root_path) }
133+
format.html { redirect_to(root_path) }
134134
format.json { render json: { message: "Quick order succeeded for #{@user.name}." }, status: :ok }
135135
end
136136
else

app/models/ability.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def initialize_koelkast
3737
# Since ordering a dagschotel uses the underlying order model,
3838
# the same rules as creating an order apply here.
3939
can :order_dagschotel, User
40+
can :quick_order, User
4041
end
4142

4243
# Regular user permissions

app/views/orders/new.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
</a>
6464
</div>
6565
<% end %>
66+
67+
<%= render "users/quick_order", products: @user.last_ordered_products %>
6668
</div>
6769
</div>
6870

0 commit comments

Comments
 (0)