Sha256: d003391732d4f8c8b73c94100981e0e224e331dc7f3d4c0a3befe7849889b8cf
Contents?: true
Size: 671 Bytes
Versions: 16
Compression:
Stored size: 671 Bytes
Contents
module AdminPictureController include Gaku::ClassNameDetector def set_picture @resource = set_resource @resource.update params.require(param_name).permit(:picture) flash.now[:notice] = t('notice.picture_update') render 'gaku/admin/shared/set_picture' end def remove_picture @resource = set_resource @resource.update(picture: nil) flash.now[:notice] = t('notice.picture_remove') render 'gaku/admin/shared/remove_picture' end private def set_resource instance_variable_set("@#{class_name_underscored}", class_name.constantize.find(params[:id])) end def param_name controller_name.singularize.to_sym end end
Version data entries
16 entries across 16 versions & 2 rubygems