Skip to content

Instantly share code, notes, and snippets.

@JonathanVeg
Created May 9, 2013 22:56
Show Gist options
  • Save JonathanVeg/5551226 to your computer and use it in GitHub Desktop.
Save JonathanVeg/5551226 to your computer and use it in GitHub Desktop.
# MODEL
class Step < ActiveRecord::Base
belongs_to :book
belongs_to :charpter
belongs_to :exercice
attr_accessible :image, :body, :number, :book, :charpter, :exercice
has_attached_file :image
end
# form - ignora a parte do flash[:notice], é só pra notícias
=form_tag('/step/cadastre', :multipart => true) do
= file_field :image, :image, :multiple => true
%br
= submit_tag 'Salvar'
- if flash[:notice]
%strong
Resumo:
%br
= flash[:notice].html_safe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment