31 Mar '13, 2am

simple_format. Like it.

The TextHelper module provides a set of methods for filtering, formatting and transforming strings, which can reduce the amount of inline Ruby code in your views. These helper methods extend Action View making them callable within your template files. Sanitization Most text helpers by default sanitize the given content, but do not escape it. This means HTML tags will appear in the page but all malicious code will be removed. Let’s look at some examples using the simple_format method: simple_format ('<a href="http://example.com/">Example</a>' ) # => "<p><a href=\"http://example.com/\">Example</a></p>" simple_format ('<a href="javascript:alert(\no!\)">Example</a>' ) # => "<p><a>Example</a></p>" If you want to escape all content, you should invoke the h method before calling the text helper. simple_format h ('<a href="http://example.com/">Example</a>' ) # => "<p>&lt;a href=\"...

Full article: http://api.rubyonrails.org/classes/ActionView/Helpers/Tex...

Tweets

This is what 2,000 calories of food looks like

treehugger.com 28 Mar '13, 3pm

BuzzFeed created this video that shows what 2,000 calories of various foods looks like. It's interesting to see how much o...

Feel like riding a bicycle made of bamboo?: Bamboobee, a Singapore-based startup, is seeking crowdfunding on K...

Feel like riding a bicycle made of bamboo?: Bam...

news.cnet.com 28 Mar '13, 5pm

The Bamboobee Revolution Nostalgic model. (Credit: Jacqueline Seng/CNET Asia) We've seen bamboo speakers , laptops , styli...

Event @ Simon's Too on April 10th, 6-8pm. Meet ...

blog.barismo.com 29 Mar '13, 11pm

Gustavo Alfaro is a fourth generation coffee farmer, but he is not your typical producer. After graduating from the Univer...

10 @Nike Air Foamposite One Colorways We'd Like to See: @TheRealJRSmith needs these.

10 @Nike Air Foamposite One Colorways We'd Like...

complex.com 28 Mar '13, 3pm

There is no arguing that the Nike Air Foamposite One has become one of the most popular sneaker models of the last five ye...

How to Live Tweet Like a Pro

seomoz.org 28 Mar '13, 10am

Provide as much context as you can. Take this tweet from SearchFest: Agility: Kinect was for games 1st, ppl hacked it, MSF...

Here’s what 2,000 calories really looks like Fa...

grist.org 26 Mar '13, 7pm

Two thousand calories is about the FDA-recommended daily intake for an adult — but what does that really look like? Well, ...

RHOBH: “I rotate my jewelry like I rotate my ti...

purseblog.com 26 Mar '13, 6pm

Last night we got a double dose of Real Housewives of Beverly Hills , with the season three finale and the first part of t...

I Am Bored: Looks Like A No Trespassing Sign To...

i-am-bored.com 28 Mar '13, 12pm

I was under the impression that I could pay for a pistol, but I couldn't take possession of it without a permit. It`s craz...

Try two putting grips like Fowler: Rickie goes traditional from long range, unorthodox for the short ones

Try two putting grips like Fowler: Rickie goes ...

golfmagic.com 27 Mar '13, 3pm

It recently came to our attention during coverage of the Arnold Palmer Invitational at the weekend that Rickie Fowler uses...

Portable Solar Power “Flower” Folds Up Like A Lotus

Portable Solar Power “Flower” Folds Up Like A L...

cleantechnica.com 26 Mar '13, 12pm

Biomimicry run amok can be a beautiful thing, and that’s the driving force behind a new portable solar power canopy called...

Japanese teen 'didn't like' mother so chopped h...

straitstimes.com 24 Mar '13, 5am

TOKYO (AFP) - A Japanese teenager who allegedly killed his mother and chopped her body into pieces has told police he simp...

Japanese teen allegedly chopped up his mother b...

straitstimes.com 24 Mar '13, 5am

TOKYO (AFP) - A Japanese teenager who allegedly killed his mother and chopped her body into pieces has told police he simp...

Japan teen 'didn't like' mother so chopped her up - Yahoo! News Singapore via @yahoosg

Japan teen 'didn't like' mother so chopped her ...

sg.news.yahoo.com 24 Mar '13, 7am

A Japanese teenager who allegedly killed his mother and chopped her body into pieces has told police he simply did not lik...

Private Island Paradise 'Laucala Island' Fiji Promises a Holiday Experience Like No Other: Located in the nort...

Private Island Paradise 'Laucala Island' Fiji P...

luxurytravelmagazine.com 25 Mar '13, 11am

Located in the north-east of the Fijian archipelago, Laucala Island has been described as a South Pacific ‘Paradise on E...

Master domainer: Like a Boss! #domains #likeabo...

domaingang.com 23 Mar '13, 8pm

You are here: Home / Domain News / Master domainer: Like a Boss! Master domainer: Like a Boss! Posted by DomainGang on Mar...