Git Product home page Git Product logo

Comments (6)

joshfrench avatar joshfrench commented on August 17, 2024
  1. You can get those from the request object in your controller action: request.remote_ip, request.user_agent, and request.referer. You should capture those and store them in the action where the message is created.
  2. 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.)
  3. You should store permalink and author_url just like any other attribute on your Message class.

Hope that helps!

from rakismet.

localguiding avatar localguiding commented on August 17, 2024

Yes, you are helping, sorry if my questions are kind dummy.

  1. I guess it is request.referrer and NOT request.referer, right ?
  2. Understood.
  3. is permalink the url where the form is located ? What is the difference between permalink and author_url ?

Thanks again !

from rakismet.

joshfrench avatar joshfrench commented on August 17, 2024

No worries, happy to help!

  1. 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.
  2. Both 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.

from rakismet.

localguiding avatar localguiding commented on August 17, 2024

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.

joshfrench avatar joshfrench commented on August 17, 2024

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.

localguiding avatar localguiding commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.