materialize-sass icon indicating copy to clipboard operation
materialize-sass copied to clipboard

Lets make simple_form generator

Open mkhairi opened this issue 9 years ago • 21 comments

Having simple form run for this framework would be really nice!

mkhairi avatar Feb 14 '15 05:02 mkhairi

my small config =>

https://gist.github.com/mediasota/7c46c8e105acc386d62f

mediasota avatar Mar 06 '15 12:03 mediasota

@mediasota , could u provide dummy app with example of generated form to test it? It would be perfect

ogonki-vetochki avatar Mar 06 '15 12:03 ogonki-vetochki

@mediasota , ха, спасибо, проверю чуть позже запушил в rubygems патч с пагинацией.

ogonki-vetochki avatar Mar 06 '15 12:03 ogonki-vetochki

@mkhairi

Any updates on this one? I'd happily take this if its not being worked on.

gizotti avatar Apr 22 '15 21:04 gizotti

@gizotti you are welcome! but probably we should do generator as separate gem 'simple_form-materialize' as R.Franca mentioned in this issue: https://github.com/plataformatec/simple_form/issues/1198#issuecomment-71917804

ogonki-vetochki avatar Apr 23 '15 08:04 ogonki-vetochki

@xamenrax

I think the generator could be part of the materialize-sass gem, it would just create an initializer with the simple_form configs and would be run only by people that want to use simple form with material.

gizotti avatar Apr 23 '15 22:04 gizotti

agree with @gizotti. All we need is to design simple_form wrappers that are compatible with materialize.

mkhairi avatar Apr 24 '15 03:04 mkhairi

I'm integrating materialize css in one of my projects and will work on the simple-form wrappers soon. I'll send a PR when I get the wrappers right and write a generator.

 

 

Gabriel Gizotti

about.me/gizotti

On Fri, Apr 24, 2015 at 1:09 PM, Mohd Khairi Mohd Adnan [email protected] wrote:

agree with @gizotti. All we need is to design simple_form wrappers that are compatible with materialize.

Reply to this email directly or view it on GitHub: https://github.com/mkhairi/materialize-sass/issues/16#issuecomment-95783761

gizotti avatar Apr 24 '15 03:04 gizotti

Very nice! Looking forward to this addition.

sergiotapia avatar Apr 24 '15 14:04 sergiotapia

Someone has any progress to share?

davidenko87 avatar May 25 '15 12:05 davidenko87

I'm using MaterializeCSS in many projects here, but I've any solution to management of error handling, anyone has a good config to share?

brunoocasali avatar Jul 13 '15 05:07 brunoocasali

Anyone got anywhere with this?

I've created a Rails 4.3 app using materialize and simple_form to create a basic contact form shown below. If I use form_for and submit the form with errors they are wrapped when the page reloads. However when I use simple_form_for the errors (and the tags which contain them) do not appear.

This is with no changes to the initializer file. Any ideas?

Also as you can see I'm having to write out the labels which I thought simple_form would do for me by default.

<%= simple_form_for @message, url: contact_path  do |f| %>
  <%= f.label :name %><br>
  <%= f.text_field :name %><br>
  <br>
  <%= f.label :email %><br>
  <%= f.text_field :email %><br>
  <br>
  <%= f.label :subject %><br>
  <%= f.text_field :subject %><br>
  <br>
  <%= f.label :message %><br>
  <%= f.text_area :message %><br>
  <br>
  <%= f.button :button, "Custom Button Text" %>
<% end %>

patricklindsay avatar Jul 20 '15 22:07 patricklindsay

I did get somewhere with it, and got it most of the main inputs working well, just got caught up with work and couldn't get the pr sent yet as I promised :/ my bad.

@patricklindsay: about your problem. It's happening because you are using the form_for syntax inside a simple_form_for block.

<%= f.input :email %> would create the label and the input for u.

gizotti avatar Jul 20 '15 22:07 gizotti

Great cheers @gizotti that sorted both issues. I'll use @mediasota config and go from there for now.

patricklindsay avatar Jul 21 '15 16:07 patricklindsay

@gizotti Thank you for your help to the community!, Do you have any news with the PR?, or a WIP example, that can we use or improve?

heberuriegas avatar Nov 10 '15 18:11 heberuriegas

Any news about this feature?

nathanpsouza avatar Dec 15 '15 18:12 nathanpsouza

+1 need this feature :)

catuss-a avatar Jan 20 '16 15:01 catuss-a

I've began to work on a gem which includes the SimpleForm configuration generator and custom inputs. Take a look here, SimpleForm-Materialize

I'm currently having difficulty adding the custom widgets I've created, check out the stackflow question

patricklindsay avatar Feb 17 '16 06:02 patricklindsay

Here is my initialization for simple_form and materialize

https://gist.github.com/gudata/d3fb9e480ffe6190e0803993b9fcdd13

It is draft because I haven't cover ALL the components. But a majority of them are working.

gudata avatar Nov 07 '16 17:11 gudata

Is there a way to get as: :select to work on this?

= f.association :tutor, collection: Tutor.all, label_method: :name, value_method: :id, as: :select

jeremiahlukus avatar Jul 29 '17 23:07 jeremiahlukus

Hi there. What about config for materialize v1? I am particularly interested in config for check_boxes.

DSKonstantin avatar May 21 '19 08:05 DSKonstantin