Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

form_for passing in class as option

Tags:

I'm trying to give my form a class. Looking through the docs, it doesn't seem like there's a way to do this, and that you can only pass in things like name like this

form_for @changeset, @action, [name: :search], fn f -> %>

Is there any way to pass in class as an option so my form html element can have a class? Perhaps like this?

form_for @changeset, @action, [class: 'form-horizontal'], fn f ->

I was digging through the phoenix source code but can't seem to find anything on it.

like image 980
Chris Jeon Avatar asked Aug 28 '15 02:08

Chris Jeon


1 Answers

It was breaking because I was using single quotes rather than double quotes for 'form-horizontal'. Single quotes habits from my Ruby programming...

like image 72
Chris Jeon Avatar answered Oct 25 '22 03:10

Chris Jeon