Multiple Actions

Hello,

This is an interesting one… I have two controllers, and in some
instances I want to call an action in the second control from the first
based on where the user is.

I know this sounds strange. Here’s an example:

From the Posts controller I want the user to be able to add a category
with an Ajax form. If they do it from here, I want to immediate call an
action in my posts_controller to add the category to the post. I have
the action already that adds the category if a user clicks the link
manually, but if they create the category there and then, it should add
it to the post.

However, if they’re just creating a normal category from the category
index action I don’t want the side effect to occur. I’d also like to
keep this all RESTful somehow, if possible.

Any thoughts?

Thanks.