Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_commentable
- @commentable = Answer.find(params[:answer_id])
- end
- def set_voteable
- @voteable = Answer.find(params[:answer_id])
- end
- def set_commentable
- @commentable = Question.find(params[:question_id])
- end
- def set_voteable
- @voteable = Question.find(params[:question_id])
- end
- def answer_params
- params.require(:answer).permit(:body)
- end
- def find_answer
- @answer = Answer.find(params[:id])
- end
- def current_question
- @question = Question.find(params[:question_id])
- end
- def comment_params
- params.require(:comment).permit(:body)
- end
- def question_params
- params.require(:question).permit(:title, :body, :user_id)
- end
- def find_question
- @question = Question.find(params[:id])
- end
- <h2 class="text-center">Post a question</h2>
- <br/>
- <%= form_for @question do |f| %>
- <%= render "shared/message" %>
- <div class="form-group">
- <%= f.text_field :title, autofocus: true, placeholder: "Title", class: "form-control" %>
- </div>
- <div class="form-group">
- <%= md_simple_editor do %>
- <%= f.text_area :body, autofocus: true, :rows => 6, style: 'width:100%;', placeholder: "Description", class: "form-control" %>
- <% end %>
- </div>
- <div class="actions">
- <%= f.submit "¡Ask!", class: "btn btn-primary btn-lg btn-block" %>
- </div>
- <% end %>
- <div/>
Add Comment
Please, Sign In to add comment