Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### features

- Add option to use a CDN
- Add option for max file size

### misc

Expand Down
1 change: 1 addition & 0 deletions app/helpers/filepicker_rails/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def retrive_legacy_filepicker_options(options)
:store_location => 'data-fp-store-location',
:store_access => 'data-fp-store-access',
:multiple => 'data-fp-multiple',
:max_size => 'data-fp-maxSize',
:onchange => 'onchange',
:class => 'class',
:value => 'value'
Expand Down
6 changes: 6 additions & 0 deletions spec/helpers/form_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
expect(form.filepicker_field(:filepicker_url, multiple: true)).to eq(html)
end

it "have correct input with 'max_size'" do
html = %{<input data-fp-apikey="123filepickerapikey" data-fp-maxSize="10"}
html << %{ id="user_filepicker_url" name="user[filepicker_url]" type="filepicker" />}
expect(form.filepicker_field(:filepicker_url, max_size: 10)).to eq(html)
end

it "have correct input with 'onchange'" do
html = %{<input data-fp-apikey="123filepickerapikey" id="user_filepicker_url"}
html << %{ name="user[filepicker_url]" onchange="track()" type="filepicker" />}
Expand Down