Ruby

Here you have the simple step you may follow: Go to your website and create a new user account Go to console [shell] bundle exec rails console [/shell] How to activate your discourse account manually(from console) if you are not receiving the confirmation email: [shell] token = User.last.email_tokens.first EmailToken.confirm(token.token) [/shell] Setup your account as an admin...

Sometimes when you're playing with new code it is kind of difficult to find out where they are declared or maybe this method are declared using metaprogramming and they are not explicitly declared: In most of the cases you can just copy your method or function and search it in the repository using ack http://beyondgrep.com/ or silver searcher(ag) https://github.com/ggreer/the_silver_searcher but if you are not able to find the method you're looking for using some of this searcher tools you can use some gem for debugging for example debugger https://github.com/cldwalker/debugger or pry https://github.com/pry/pry.

In the past days I attended the http://gophergala.com/ event which it was a really good start in the Golang world, I learned some stuff about Golang, after to read this previous sentences you are going to say WTF is this post about ruby or Golang well I wanted to start writting about the Gophergala because the code that we are going create is created with the aim and purpose of cloning all the repositories from an account in this case the gophergala organization using ruby in a rake task, Why Am I doing this? just to put in only one place all these great resources (I will put in my account all of this repositories in one repository).

How to apply a Spree coupon promotion within console: [ruby] # search the order in this case I'm using the last one o = Spree::Order.last # apply the coupon code you already create from the admin panel section o.coupon_code = 'order_discount' # apply the coupon code specified handler = Spree::PromotionHandler::Coupon.new(o).apply [/ruby] ...

Just for future reference in Spree you can use the following code in spite of authenticate an existent user created in a Spree Store [javascript] var server = 'http://localhost:3000'; var userAuthUrl = server + '/login.js'; var data = {spree_user: {email: "spree@example.com", password: "spree123"}} $.ajax({ type: "POST", data: data, url: userAuthUrl, success: function(data, textStatus, jqXHR) { console.log(data); console.log(textStatus); console.log(jqXHR); } }); [/javascript]

Hello guys I want to share with you about this problems with wrong color or quality for the uploaded images using Paperclip gem, Imagemagick and Heroku.com. The fix that we did it is related with the Imagemagick configuration and updates in order to fix this problem you have to do the following actions: First you have to set a new environment variables on heroku running the following command:

hello guys I want to write about selectors, overriding, and defaces in spree with the DSL for Spree: In this time I want to share the code that I have created for a simple task. The scenario is the following: I want to edit option type values in the admin section, if you take a look into the code of spree you'll see that some of the views responsible for the option type edition are located in: [shell] backend/view/spree/admin/option_types/_option_value_fields.html.erb [/shell] and [shell] backend/view/spree/admin/option_types/edit.html.erb [/shell]