Archive for the ‘Code’ Category
How to add a class to the form_for tag in Ruby on Rails
I’ve searched for a while and couldn’t figure this out until I actually picked up my book and browsed the source of examples. I’ll get straight to the code:
<% form_for :user, :url => users_path,:html => { :class => ’standard-form’ } do |f| -%>
That produces:
How to embed high-quality YouTube videos to your site
It’s very simple. Just add the code below to the end of the value and embed src part of the embed code.
&ap=%2526fmt%3D18
Where exactly are the ‘value’ and ‘embed src’ tags? Look for these items in the code:
…………..value=”http://www.youtube.com/v/wmaTyD7NnCI&hl=en&fs=1&ap=%2526fmt%3D18“……….embed src=”http://www.youtube.com/v/wmaTyD7NnCI&hl=en&fs=1&ap=%2526fmt%3D18” ………
Try it out!