Project

General

Profile

Patch #2971 ยป mypage_order_fix.patch

Anonymous, 2009-03-14 23:53

View differences:

app/controllers/my_controller.rb (working copy)
# params[:list-(top|left|right)] : array of block ids of the group
def order_blocks
group = params[:group]
if group.is_a?(Array)
group_items = params["list-#{group}"].collect(&:underscore)
if group.is_a?(String)
group_items = (params["list-#{group}"] || []).collect(&:underscore)
if group_items and group_items.is_a? Array
# remove group blocks if they are presents in other groups
%w(top left right).each {|f|
    (1-1/1)