Comments (6)
- You can get those from the request object in your controller action:
request.remote_ip
,request.user_agent
, andrequest.referer
. You should capture those and store them in the action where the message is created. - You'll need to create a migration to add those fields to your Message model. You can call the fields whatever you want, and map them with
rakismet_attributes
(or you can use the default names.) - You should store
permalink
andauthor_url
just like any other attribute on your Message class.
Hope that helps!
from rakismet.
Yes, you are helping, sorry if my questions are kind dummy.
- I guess it is request.referrer and NOT request.referer, right ?
- Understood.
- is permalink the url where the form is located ? What is the difference between permalink and author_url ?
Thanks again !
from rakismet.
No worries, happy to help!
- I know it's spelled wrong, but it's actually referer -- it was misspelled it in the original HTTP spec in 1996! This can be blank sometimes, so it's not required.
- Both
permalink
andauthor_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.
from rakismet.
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 !
from rakismet.
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?
from rakismet.
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.
from rakismet.
Related Issues (20)
- ArgumentError: invalid byte sequence in UTF-8 in ruby-1.9.2-p136 HOT 1
- rakismet_attrs not propogated to subclasses HOT 2
- Define raskimet attrs with accepts_nested_attributes_for HOT 4
- Doubts with the response HOT 4
- SocketError (getaddrinfo: nodename nor servname provided, or not known): HOT 1
- Turn off rakismet in tests HOT 1
- permalink never set (or used) HOT 7
- Rakismet don't work HOT 1
- Rails 4 not compatible?
- user_role is not working HOT 5
- List required fields? HOT 1
- Building headers with Rails.version causes NoMethodError
- How does the model have access to the request environment? HOT 7
- Problem when validating extra attributes HOT 1
- permalink parameter is sent as comment_permalink HOT 2
- Unicode URL support. HOT 2
- Rakismet in test and development environments? HOT 5
- v1.0.1 doesn't work with Rails 2.3.10 (possibly anything pre Rails 3?) HOT 2
- rakismet-1.0.0/lib/rakismet/railtie.rb:12:in `key': wrong number of arguments(0 for 1) (ArgumentError) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rakismet.