Comments (8)
Good idea, however, I feel it might be a mess to have to deal with column classes.
One of their examples:
<div class="row collapse">
<div class="small-3 large-2 columns">
<span class="prefix">http://</span>
</div>
<div class="small-9 large-10 columns">
<input type="text" placeholder="Enter your URL...">
</div>
</div>
The erb might be:
<%= f.text_field :url, label: "URL", placeholder: "Enter your URL...", prefix: "http://", prefix_column_class: "small-3 large-2", input_column_class: "small-9 large-10" %>
from foundation_rails_helper.
Or maybe
<%= f.text_field :url, label: "URL", placeholder: "Enter your URL...", prefix: "http://", prefix_small_columns: 3, prefix_large_columns: 10 %>
Then, subtract 12 from each to get the input's columns classes.
from foundation_rails_helper.
Actually, it would be better to keep the prefix settings separate:
<%= f.text_field :url, label: "URL", placeholder: "Enter your URL...", prefix: { value: "http://", small: 3, large: 10 } %>
@djkz, If you want to work on a pull request, we can merge it.
from foundation_rails_helper.
It gets a bit complicated if you want to support buttons and mixed prefixes and postfixes. I wonder if using flex would be a cleaner solution? http://philipwalton.github.io/solved-by-flexbox/demos/input-add-ons/
from foundation_rails_helper.
That looks nice. However, does foundation have any flexbox built into their styles? I don't think we should add css to this gem.
from foundation_rails_helper.
Looks like not yet, it's planned for the next version: http://zurb.com/article/1333/foundation-a-new-grid
Wrapping everything into a row and calculating main element's size from the 12 - prefix - postfix is the way to go for now, not sure if it's possible to also support buttons and other elements that they showed in their example. Maybe by passing the content_tag for the element directly into the prefix: property but that can get pretty complicated really fast.
from foundation_rails_helper.
As you say, anything more complicated than a span is probably a bad idea. The user can always fallback to making the row/columns themselves. And if they only need to support IE 10+, they can use flexbox.
from foundation_rails_helper.
Fix merged.
from foundation_rails_helper.
Related Issues (20)
- Radio Button Helper Renders Value in Label HOT 2
- Needs a version bump. HOT 14
- Migrate TravisCI to container-based infrastructure HOT 1
- Remove Ruby 1.9.3 from supported Rubies HOT 13
- Support for Foundation 6 HOT 4
- fggh HOT 2
- Support rails 5 HOT 1
- alias_method_chain is deprecated HOT 6
- Failing spec with Rails 5 HOT 3
- Release a new gem version for Rails 5 support HOT 2
- Foundation 6 - Form input "hint" is now "help text" HOT 1
- Foundation 6 - Change default button class HOT 2
- Release 3.0.0 HOT 7
- Make error_for method in form_builder public HOT 1
- Overriding the field_error_proc HOT 2
- display_flash_messages return nil on redirection HOT 4
- Newest changes that include update to support rails 6 in gemspec not in rubygem.org HOT 2
- Can we release a new version of the gem so we can upgrade our rails to >= 6.1 HOT 1
- Publish v4.0.0 code on GitHub HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundation_rails_helper.