Project

General

Profile

Actions

Patch #14766

closed

Better block detection on my page

Added by Daniel Felix about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi there,

I'm not sure if this is really better, but in my eyes this looks a little bit better.

I checked this line: source:/trunk/app/controllers/my_controller.rb#L142
Replace:

unless %w(top left right).detect {|f| (@blocks[f] ||= []).include?(k)}
    @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]
end

with:
unless @blocks.map{ |key, value| value}.flatten.include?(k)
    @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]
end

This type don't need a list of defined areas (left,right,top) and could handle even more areas.

Best regards,
Daniel

Actions

Also available in: Atom PDF