Skip to content

Instantly share code, notes, and snippets.

@jtoy
Created March 30, 2009 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtoy/87657 to your computer and use it in GitHub Desktop.
Save jtoy/87657 to your computer and use it in GitHub Desktop.
= error_messages_for :grammar_rule, :id => "error"
- form_for(@grammar_rule) do |f|
%div
About Rule
= f.text_field :title
%div
About language
=f.select :language_id,@languages.map{|x| [t(x), x.id] }
- f.fields_for :explanations do |e|
%div
Written in
= e.select :language_id,@languages.map{|x| [t(x), x.id] }
%div
= e.label :content, 'Explanation'
= e.text_area :content
%h1 Write an example
- f.fields_for :examples do |ex|
- if ex.object.new_record?
= ex.label :content, 'Example'
= ex.text_area :content, :rows => 2
%a{:href=>"#"} another example
= f.submit t("submit",:default=>'Submit')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment