Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- div class="hidden_edit_form"
- = render "answers/quick", answer: answer
- = form_for answer do |f|
- = f.hidden_field :user_id, :value => current_user.id
- .field
- = f.label :text
- = f.text_area :text
- .actions = f.submit
- $(document).ready(function(){
- $(".show_edit_form").click(function(){
- $(".hidden_edit_form").show();
- });
- });
- $(document).ready(function(){
- $(".show_edit_form").click(function(event){
- buttonEl = $(event.target); //кнопка на которую нажали
- // код для нахождения нужной формы рядом с нажатой кнопкой к примеру:
- var form = buttonEl.parents('hidden-edit-form');
- form.show();
- });
- });
Add Comment
Please, Sign In to add comment