Method: FilepickerRails::ApplicationHelper#filepicker_save_button

Defined in:
app/helpers/filepicker_rails/application_helper.rb

#filepicker_save_button(text, url, mimetype, options = {}) ⇒ Object

Creates a button allowing the user to download a file (or upload it to any of the supported services). Set the content of the button on the text parameter. The url of the content you want the user to save. Define the mimetype of the content. Accepts a optional options parameter.

Options

  • :container - Where to show the file picker dialog can be modal, window or the id of an iframe on the page.
  • :services - What services your users can upload to. Ex: BOX, COMPUTER, FACEBOOK.
  • :save_as_name - A recommended file name. The user can override this.

Examples

filepicker_save_button "Save", @user.filepicker_url, "image/jpg"
# => <button data-fp-apikey="..." data-fp-mimetype="image/jpg" data-fp-url="https://www.filepicker.io/api/file/hFHUCB3iTxyMzseuWOgG" name="button" type="submit">save</button>

68
69
70
71
72
# File 'app/helpers/filepicker_rails/application_helper.rb', line 68

def filepicker_save_button(text, url, mimetype, options = {})
  export_widget(text, url, mimetype, options) do
    button_tag(text, options)
  end
end