Commit 18329cab550773199c14765d041eb2ff7e30539e
1 parent
18a8487d
Exists in
master
and in
29 other branches
rails3: add mandatory argument to blocks passed to instance_eval
Showing
2 changed files
with
8 additions
and
3 deletions
Show diff stats
app/models/profile_image_block.rb
... | ... | @@ -15,8 +15,11 @@ class ProfileImageBlock < Block |
15 | 15 | def content(args={}) |
16 | 16 | block = self |
17 | 17 | s = show_name |
18 | - lambda do | |
19 | - render :file => 'blocks/profile_image', :locals => { :block => block, :show_name => s} | |
18 | + lambda do |object| | |
19 | + render( | |
20 | + :file => 'blocks/profile_image', | |
21 | + :locals => { :block => block, :show_name => s } | |
22 | + ) | |
20 | 23 | end |
21 | 24 | end |
22 | 25 | ... | ... |
app/models/sellers_search_block.rb
1 | 1 | class SellersSearchBlock < Block |
2 | 2 | |
3 | + attr_accessible :title | |
4 | + | |
3 | 5 | def self.description |
4 | 6 | _('Search for enterprises and products') |
5 | 7 | end |
... | ... | @@ -18,7 +20,7 @@ class SellersSearchBlock < Block |
18 | 20 | |
19 | 21 | def content(args={}) |
20 | 22 | title = self.title |
21 | - lambda do | |
23 | + lambda do |object| | |
22 | 24 | render :file => 'search/_sellers_form', :locals => { :title => title } |
23 | 25 | end |
24 | 26 | end | ... | ... |