jamesfwz / materialize-form Goto Github PK
View Code? Open in Web Editor NEWThis gem includes a generator for SimpleForm configuration with Materialize.
Home Page: http://materialize-form.herokuapp.com/
License: MIT License
This gem includes a generator for SimpleForm configuration with Materialize.
Home Page: http://materialize-form.herokuapp.com/
License: MIT License
= f.association :tutor, collection: Tutor.all, label_method: :name, value_method: :id, as: :select
When I use this the field disappears completely. However, if I do the same code with check_box it works. How can I use the select menu? Is this a bug or am I doing something incorrect.
in the generator the following line:
ba.use :tag, tag: 'span', class: 'lever'
end up generating
<span tag="span" class="lever boolean optional"></span>
which is incorrect. Not sure how we can correct this?
##Help
to put maximum date selection in date picker?
Please support Turbolinks replacing
$(document).ready(function() {
if($('form').length > 0) {
window.materializeForm.init()
}
});
by
$(document).on('turbolinks:load', function() {
if($('form').length > 0) {
window.materializeForm.init()
}
});
Hello there!
I had this problem (Dogfalo/materialize#1440), but the trick proposed wasn't enough (thanks to simple form, the 'ids' and 'for' attributes were already filled).
I finally figured out it was because I had several modals with several forms (ex: edit_task_1 ; edit_task_2, etc) and the 'id' of inputs and the attribute 'for' of the labels where the same in the forms (task_user_ids for all of them) and that's why they could not be checked.
I ended up doing something like this:
// In my shared.js.coffee
// Fix for simple form + materialize checkboxes in several modals
$('p.checkbox').each () ->
form_id = $(this).closest('form').attr('id')
input = $(this).children('input')
label = $(this).children('label')
input_value = input.val()
current_input_id = input.attr('id')
new_name = "#{form_id}_#{current_input_id}_#{input_value}"
$(input).attr('id', new_name)
$(label).attr('for', new_name)
Hope it can help someone in the future! :) Would be perfect if we could have it in this gem too! :)
Thanks!
There should be an option to choose for checkboxes to be filled in.
Right now I have just removed //= require material-form
from application.js
and just written my own version without $('input[type=checkbox]').addClass('filled-in')
Select function name is now formSelect() instead of material_select()
Hello!
I am trying to translate the datepicker component of materialize and it is not working. I am using this code inside application.js
:
$(document).on('turbolinks:load', function() {
window.materializeForm.init();
Materialize.updateTextFields();
$('select').material_select();
...
$('.date').pickadate({
labelMonthNext: 'Próximo mês',
labelMonthPrev: 'Mês anterior',
labelMonthSelect: 'Selecione um mês',
labelYearSelect: 'Selecione um ano',
monthsFull: [ 'Janeiro', 'Feveiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ],
monthsShort: [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ],
weekdaysFull: [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado' ],
weekdaysShort: [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb' ],
weekdaysLetter: [ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S' ],
today: 'Hoje',
clear: 'Limpar',
close: 'Fechar'
});
...
});
I think it is not working because materialize-form is calling $('.date').pickadate(...)
somewhere after my code run.
Can anybody help me with this?
When using radio button input within a Simple Form as below
= f.input :options, as: :radio_buttons
The generated HTML follows the old format,
<input name="group1" type="radio" id="test1" />
<label for="test1">Red</label>
while it should be look something like below in version 1.0.0
<label>
<input name="group1" type="radio" checked />
<span>Red</span>
</label>
As a result, the radio buttons are not displayed correctly. They are not visible actually.
the published version in RubyGems doesn't have the last changes related to css v1 support. would you mind to update the version ? Thnx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.