app/controllers/concerns/controller_extensions.rb
# Force an extension to every url. (LOD)
Force an extension to every url. (LOD)
Force an extension to every url . ( LOD )
def ensure_extension
    unless params[:format] || !request.get?
      safe_params = params.except(:host, :port, :protocol, :domain, :subdomain).permit!
      flash.keep
      redirect_to url_for(safe_params.merge(format: (request.format && request.format.symbol) || :html))
    end
  end
def ensure_extension unless params [ :format ] || ! request . get? safe_params = params . except ( :host , :port , :protocol , :domain , :subdomain ) . permit! flash . keep redirect_to url_for ( safe_params . merge ( format : ( request . format && request . format . symbol ) || :html ) ) end end
Force an extension to every url.
Force an extension to every url .
# FIXME: convert to whitelist