Skip to content

Instantly share code, notes, and snippets.

@abacha
Created February 14, 2013 13:25
Show Gist options
  • Select an option

  • Save abacha/4952757 to your computer and use it in GitHub Desktop.

Select an option

Save abacha/4952757 to your computer and use it in GitHub Desktop.
def form_file_field(form, attr, options = {})
options[:class] ||= ""
options[:class] += " span12" unless options[:class].include?("span")
content_tag :div, :class => "input-append", "rel" => "pretty-file" do
form.file_field(attr, :class => "hide") +
text_field(:file, attr, :class => "disabled #{options[:class]}") +
link_to(t("browse"), "#", :class => "btn")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment