docbrown/app/controllers/admin/podcasts_controller.rb
Anna Buianova b630fcad0d Removed fetching podcasts from a callback (#3098)
* Removed fetching podcasts from a callback

* Remove hacks that avoid fetching podcasts while seeding and running tests
2019-06-13 12:23:55 -04:00

20 lines
529 B
Ruby

module Admin
class PodcastsController < Admin::ApplicationController
def create
resource = resource_class.new(resource_params)
authorize_resource(resource)
if resource.save
Podcasts::GetEpisodesJob.perform_later(resource.id)
redirect_to(
[namespace, resource],
notice: translate_with_resource("create.success"),
)
else
render :new, locals: {
page: Administrate::Page::Form.new(dashboard, resource)
}
end
end
end
end