
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
= labelize
This very very simple gem is handy for several things:
First, define the label of your model (it must be a String column):
class Country label :name end
Now you are free of "collects" or "collection_select". Look:
You can do that:
irb> country = Country.create :name => 'Brazil' irb> puts country Brazil => nil
And that:
irb> Country.to_sentence => "Brazil, Uruguay and Argentina"
At last, but not the least, you can find items by name automatically:
irb> Country.find('Brazil') => #<Country id: 72, name: "Brazil", ...>
If you have a specific label for searching (like a permalink column), you can set it as a second parameter:
class Country label :name, :permalink end
irb> Country.find('south-corea') => #<Country id: 31, name: "South Corea", :permalink => 'south-corea' ...>
It works out-of-the-box with inherited_resources and i think it can be used with has_permalink also.
== Install
Just add this to your Gemfile (assuming your source is RubyForge)
gem 'labelize', '0.1.3'
And then run
bundle install
== Ideas
This gem is still beta, so please, if you have any thought on were the "labels" idea can also be usefull please feel free to share. My twitter is @joaomilho.
== Rails version
Labelize is only tested with Rails 3.0.0.beta4. Upgrade baby!
== Note on Patches/Pull Requests
== Copyright
Copyright (c) 2010 Juan Maiz. See LICENSE for details.
FAQs
Unknown package
We found that labelize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.