Closed localguiding closed 12 years ago
request.remote_ip
, request.user_agent
, and request.referer
. You should capture those and store them in the action where the message is created.rakismet_attributes
(or you can use the default names.)permalink
and author_url
just like any other attribute on your Message class.Hope that helps!
Yes, you are helping, sorry if my questions are kind dummy.
Thanks again !
No worries, happy to help!
permalink
and author_url
are more useful for a traditional blog model. Permalink
usually refers to the permanent URL for a blog post, so in this case maybe you should use the URL for the parent conversation. Author_url
usually means whatever URL the author of a comment (not the author of the parent post) would leave along with their comment -- for instance, a link back to the commenter's own blog. If you're not asking your message authors for a URL, it's OK to leave this field out -- it's not required.Hi Josh, thanks for your answers ! I really appreciate your help. Just one more regarding the referrer/referer issue. I understand that from rails perspective, referrer is actually request.referer, that's ok. So my question is, how should I name my table field, referer or referrer ?
Thanks for your support !
I'd probably call it referrer
so it matches the Rakismet default, but if you wanted to call it referer
or something else you can always map it with rakismet_attrs
.
Do you think it would be clearer if I changed the Rakismet attribute to referer
so that it matched the HTTP spec?
OK, I will follow your recommendation and call it referrer
.
Regarding your question, I'm not sure what's the best option, but I'd say to not change it and leave it like it is because this way the map in not needed. Thanks, Alvaro.
Hi, I read that you have to store optional request variables if you want to process your comments in a later stage. It means that I have to save user_ip, user_agent and referrer in one of my models.
Thanks !