class MyController < ApplicationController
argible(:foo => :@bar)
def action_one
p "Bar instance variable was set to: #{@bar}"
end
end
Notice that the action method, action_one, has NO arguments. But the argible annotation was passed :foo => :@bar. Argible will interpret that you want the resolved value of 'foo' to be set upon the instance variable named '@bar'. This happens because the symbol on the right hand side is prefixed with the character '@'. Without this Argible will raise an Error informing you that there is no such argument.
No comments:
Post a Comment