FAQ
i am looking for help for changing image attachment styles settings in
spree_current (master)

Search Discussions

  • Weston Platter at Jun 14, 2013 at 6:11 pm
    Sanjeev,

    Based on the docs (
    http://guides.spreecommerce.com/developer/products.html#images), you can
    adjust the image configurations from the spree initializer file,

    # /app/config/initializers/spree.rb

    Spree::Config do |config|
       config[:attachment_styles] = { :my_new_min => '60x60>'} # NOTE! the '>'
    is acutally needed
    end

    This worked for me on Spree 2.0.2.




    On Thursday, June 13, 2013 8:28:12 PM UTC-6, sanjeev kumar sharma wrote:


    On Friday, June 14, 2013 7:43:27 AM UTC+5:30, sanjeev kumar sharma wrote:

    i am looking for help for changing image attachment styles settings in
    spree_current (master)
    i tried by adding configuration settings in preferences table ..
    Spree::Preference.where(:key =>
    "spree/app_configuration/attachment_styles").first_or_create!(:value =>
    '{"mini":"48x48>","small":"160x160>","product":"240x240>","large":"600x600>","medium":"240x240>"}',
    :value_type => 'string')
    ---but it is not working
  • Weston Platter at Jun 14, 2013 at 7:15 pm
    I restarted my app localing, and it crashed. Therefore, make sure to use an
    actual JSON string, EG,

    Spree::Config do |config|
       config[:attachment_styles] =
    "{\"new_mini\":\"50x50>\",\"new_small\":\"100x100>\"}"
    end

    On Friday, June 14, 2013 12:10:50 PM UTC-6, Weston Platter wrote:

    Sanjeev,

    Based on the docs (
    http://guides.spreecommerce.com/developer/products.html#images), you can
    adjust the image configurations from the spree initializer file,

    # /app/config/initializers/spree.rb

    Spree::Config do |config|
    config[:attachment_styles] = { :my_new_min => '60x60>'} # NOTE! the
    '>' is acutally needed
    end

    This worked for me on Spree 2.0.2.




    On Thursday, June 13, 2013 8:28:12 PM UTC-6, sanjeev kumar sharma wrote:


    On Friday, June 14, 2013 7:43:27 AM UTC+5:30, sanjeev kumar sharma wrote:

    i am looking for help for changing image attachment styles settings in
    spree_current (master)
    i tried by adding configuration settings in preferences table ..
    Spree::Preference.where(:key =>
    "spree/app_configuration/attachment_styles").first_or_create!(:value =>
    '{"mini":"48x48>","small":"160x160>","product":"240x240>","large":"600x600>","medium":"240x240>"}',
    :value_type => 'string')
    ---but it is not working
  • Sanjeev kumar sharma at Jun 15, 2013 at 5:06 am
    thanks Weston Platter
    On Friday, June 14, 2013 7:43:27 AM UTC+5:30, sanjeev kumar sharma wrote:

    i am looking for help for changing image attachment styles settings in
    spree_current (master)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedJun 14, '13 at 2:13a
activeJun 15, '13 at 5:06a
posts4
users2
websitespreecommerce.com
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase