Added possibility to give feedbacks via ajax form. Closes #2
* Feedback message will send to error_recipients, configured in app_config.yml
This commit is contained in:
parent
b84ec884bd
commit
c7e37fc7b2
12 changed files with 66 additions and 7 deletions
20
app/controllers/feedback_controller.rb
Normal file
20
app/controllers/feedback_controller.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class FeedbackController < ApplicationController
|
||||
|
||||
def new
|
||||
render :update do |page|
|
||||
page.replace_html :ajax_box, :partial => "new"
|
||||
page.show :ajax_box
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
unless params[:message].blank?
|
||||
Mailer.deliver_feedback(current_user, params[:message])
|
||||
end
|
||||
|
||||
render :update do |page|
|
||||
page.replace_html :ajax_box, :partial => "success"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue