How to format a modal with form builder

276 views Asked by At

I am using a form builder in ruby(1.9.3) rails(3.1.3) inside a modal. I want to put the 'bulk' of the form inside the body and the submit button inside the footer. However, the footer is outside the scope of the form builder. What is the best option to accomplish this? Use funky CSS tricks to make it appear that way? or is there a more elegant solution?

= form_for @review, remote: true do |f|
 .control-group
   .controls
     = f.hidden_field :rating, value: @review.rating
     - 5.times do |i|
       .office_rate.active_rate{ class: "rate_#{i+1}", data: {rate: i+1}}
 .control-group
   %label.control-label Review Title
   .controls
     = f.text_field :title, class: 'span5', title: "review title"
 .control-group
   %label.control-label Message
   .controls
     = f.text_area :message, class: 'span5', rows: 5, title: "message"
 %hr{style:'align:left;'}
 = f.hidden_field :date, value: Time.now
 = f.submit 'Submit Your Review', class: 'btn btn-info'
1

There are 1 answers

0
Brad Werth On BEST ANSWER

You really only have three choices: submit the form using javascript, expand the scope of your form, or resort to the aforementioned funky CSS tricks. I would try really hard to just have a more conventional approach, but would lean toward the js submission, if I had to. You could always use the funky CSS tricks, if you need a non-js fallback...