app/controllers/extensions_controller.rb
#
# PUT /extensions/:extension/toggle_featured
#
# Allows an application admin to set an extension as featured or
# unfeatured (if it is already featured).
#
PUT /extensions/:extension/toggle_featured
Allows an application admin to set an extension as featured or
unfeatured (if it is already featured).
PUT / extensions / : extension / toggle_featured Allows an application admin to set an extension as featured or unfeatured ( if it is already featured ) .
def toggle_featured
    authorize! @extension
    @extension.update_attribute(:featured, !@extension.featured)
    redirect_to(
      owner_scoped_extension_url(@extension),
      notice: t(
        'extension.featured',
        extension: @extension.name,
        state: "#{@extension.featured? ? 'featured' : 'unfeatured'}"
      )
    )
  end
def toggle_featured authorize! @extension @extension . update_attribute ( :featured , ! @extension . featured ) redirect_to ( owner_scoped_extension_url ( @extension ) , notice : t ( 'extension.featured' , extension : @extension . name , state : "#{@extension.featured? ? 'featured' : 'unfeatured'}" ) ) end
PUT /extensions/:extension/toggle_featured
Allows an application admin to set an extension as featured or
unfeatured (if it is already featured).
PUT / extensions / : extension / toggle_featured Allows an application admin to set an extension as featured or unfeatured ( if it is already featured ) .