Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

linkformatter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkformatter

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

URL Formatter Build Status

Format and validate a URL attribute in Active Record. This is an example gem created for RailsCasts episode #301.

Installation

Add to your Gemfile and run the bundle command to install it.

gem "url_formatter"

Requires Ruby 1.9.2 or later.

Usage

Call format_url in an ActiveRecord class and pass the name of the attribute you wish to format into a URL and validate.

class Comment < ActiveRecord::Base
  format_url :website
end

This will automatically add "http://" to the beginning of the website attribute upon saving if no protocol is present. It will also do validation to ensure it looks like a URL.

Development

Questions or problems? Please post them on the issue tracker. You can contribute changes by forking the project and submitting a pull request. You can ensure the tests passing by running bundle and rake.

This gem is created by Ryan Bates and is under the MIT License.

FAQs

Package last updated on 29 Nov 2011

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc