Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds mailer and feedback form functionality #130

Merged
merged 1 commit into from
May 23, 2014
Merged

adds mailer and feedback form functionality #130

merged 1 commit into from
May 23, 2014

Conversation

mejackreed
Copy link
Contributor

Fixes #37

Adds feedback form functionality to application with test suites. I am scoping out the quick book report button to another ticket as it may depend on #78

One issue is that the html rendering of the flash is not rendering html tags correctly. Any suggestions? html_safe does not seem to work.

screen shot 2014-05-22 at 2 26 00 pm

screen shot 2014-05-22 at 2 26 13 pm

screen shot 2014-05-22 at 2 26 28 pm

screen shot 2014-05-22 at 2 26 41 pm

if request.post?
if validate
RecordMailer.submit_feedback(params, request.remote_ip)
flash[:success] = t('blacklight.feedback_form.success').html_safe
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so html_safe here does not appear to be helping with rendering tags correctly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this since we're now calling #html_safe in the overridden partial.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.23%) when pulling 425a40be6f2fe257bb8027785670bf1e0feff53e on feedback into 9bd2efa on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.21%) when pulling ce4a2b299fe867098eca9cb4ae6fc24dae34bc46 on feedback into 094013e on master.

else
false
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be written a little more concisely as:

def show_feedback_form?
  !controller.instance_of?(FeedbackFormsController)
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a simple helper test may be in order (just in case this logic ever grows in complexity).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jkeck
Copy link
Contributor

jkeck commented May 23, 2014

What's w/ the empty app/views/feedback_forms/create.html.erb?

Under which condition do we get there (and should we try to prevent that)?

@mejackreed
Copy link
Contributor Author

@jkeck we don't anymore it seems... removing

class RecordMailer < ActionMailer::Base

def submit_feedback(params, ip)
if !params[:name].blank?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think params[:name].present? may read a little better. (as well as params[:to].present? below)

That may just be my personal style, so I leave that 💯 % up to your discretion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@coveralls
Copy link

Coverage Status

Coverage increased (+0.21%) when pulling 8015e78 on feedback into f854d57 on master.

@mejackreed
Copy link
Contributor Author

@jkeck :shipit:

jkeck pushed a commit that referenced this pull request May 23, 2014
adds mailer and feedback form functionality
@jkeck jkeck merged commit 4dd5926 into master May 23, 2014
@jkeck jkeck deleted the feedback branch May 23, 2014 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feedback Form
3 participants