Git Product home page Git Product logo

Comments (4)

ujh avatar ujh commented on May 23, 2024

You have to use Carmen.exclude_countries and use something like (Carmen.country_codes - [list of countries you want]) to set it.

from carmen.

sanjusoftware avatar sanjusoftware commented on May 23, 2024

Were you able to do this. I am trying to put this statement in the initializers to limit the countries show only to US and CA, but it gives me error:

Carmen.exclude_countries = (Carmen.country_codes - %w(US CA))

undefined method `country_codes' for Carmen:Module (NoMethodError)

Can you please help me in doing this...

from carmen.

ujh avatar ujh commented on May 23, 2024

I think this only works for Carmen 0.2.x. I'm not sure if and how that's possible with the new 1.0. But according to the README you should be able to use the old API by adding an additional require. I haven't checked which file you have to require though.

from carmen.

jim avatar jim commented on May 23, 2024

I was originally planning on writing an API compatibility layer, but I haven't had time and I've decided that it's better to get 1.0 out the door than have that hold up the entire library (which contains many other improvements).

If you can use 1.x (and carmen-rails 1.0.0.beta3), you can use the example in the README there to achieve something similar to what you want.

You'll need to add this to your Gemfile:

gem 'carmen-rails', '~> 1.0.0.beta3'

You can then remove any other reference to carmen from your Gemfile.

from carmen.

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.