A language-independent collaboratively edited question and answer site for programmers.
I found this very helpful snippet in this thread on the devise google group initializers/some_initializer.rb: Warden::Strategies.add(:custom_strategy_name) do def valid? # code here to check whether to try and authenticate using this strategy; return true/false end def authenticate! #...
I have some question ... example: a user will buy something for his USD Check his USD Balance Deduct the USD from his account Make an Order -> order queue user becomes his item and the other one becomes his USD Lets say, the users makes 5 requests in the same second (very fast). So it...
You're in luck, friend. My first Rails project (7 years ago) was against a horribly set up SQL Server database. Per the above, you need to set up your database.yml appropriately. But for an existing database, obviously it is unlikely that the table and column names conform to the Rail...
I've just created a new amazon Linux instance and installed ruby 1.9.3 and rails 3.2.8. Upon creating a new project I immediately receive failures due to sqlite3. The error is: [root@xxxxx fun]# rails server /usr/local/share/gems/gems/sqlite3-1.3.6/lib/sqlite3.rb:6:in `require': canno...
I'm creating an e-mail notification in a .text.haml document. How does one denote a blank line? = @variable.name + " , you have a new update." = = = "There has been new activity." In the above example I would like the two lines that have just the haml '=' on them to be blank lines but...
I'm switching from PHP to Ruby on Rails and I'm loving it, the only thing is I'm so used to Twitter Bootstrap for most of my designs and now I feel crippled without it, I followed some tutorials like adding bootstrap-sass and what not to my Gemfile , but I still appear to be missing i...
I'm kind of stuck with this problem. I am currently trying to host a Rails3/Ruby1.9.3 App on a shared host(Site5). They only provide 1.8.7 for Ruby. So, I tried installing RVM so I can make use of Ruby 1.9.3. After installing RVM successfully, running 'bundle install', I encountered t...
The word "deployment" can have two meanings depending on the context. You are also confusing the roles of Apache/Nginx with the roles of other components. Apache vs Nginx They're both web servers. They can serve static files but - with the right modules - can also serve dynamic web ap...