Pregunta

I want to put spreedly in my new rails app.Because i am newbie can anyone help me with the spreedly gem?It says you must Configure your API key and site name for your account:

RSpreedly::Config.setup do |config|
  config.api_key        = "your-api-key"
  config.site_name      = "your-site-name"
end

Where should i put that?I need to make a initializer for this? And then i want to have a subscription system.Should i have to make a controller to handle subscriptions?Please Help!

¿Fue útil?

Solución

I would put that code in config/initializers/spreedly.rb.

Without knowing more about your application, it's hard to answer your second question, but I would say: yes.

Otros consejos

It might be environment specific so you could do this in initializer

if Rails.env.development?
elseif Rails.env.test?
else
...

Or just put different values in test.rb, develoment.rb and production.rb

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top