rails: checking which controller method was called from within the model

Posted by bandhunt on Stack Overflow See other posts from Stack Overflow or by bandhunt
Published on 2010-05-28T00:04:24Z Indexed on 2010/05/28 0:21 UTC
Read the original article Hit count: 482

Filed under:
|

Is there a way to check which controller method was called from within the model?

Example: Say the controller create method was called:

def create
     do something
end

Then in the model do something only when create in the controller was called

if create?
      do something
end

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby