I have the following before_filter
:
def find_current_membership
respond_to do |wants|
wants.html { @current_membership = @group.memberships.for(@current_user) }
wants.rss {}
wants.js { @current_membership = @group.memberships.for(@current_user) }
end
end
I would like to share the code for the HTML and JS blocks. Is there a better way than just throwing the code into a method? I was hoping this would work:
def find_current_membership
respond_to do |wants|
wants.rss {}
wants.all { @current_membership = @group.memberships.for(@current_user) }
end
end
But alas, it did not.