Confusing about before_filter do |controller|

so could I use a code like

before_filter do |controller|
controller.god = “Mygod”
end

and used god or @god veriable in layout?

it seems @god ok. but why it’s possible?

Hi Zhenning G.

 From api it says before_filter accepts a block with controller 

passed.“The block has access to both the request and response objects
complete with convenience methods for params, session, template, and
assigns”. And in your case ‘god’ an instance variable which may be
declared somewhere with attr_writer or attr_accessor

Sijo K George