Tag: Rails

How to use serialized object in Active Record using Rails?

Serializing Object Will help us to store multiple column values in single Database column and even making processing using that column simple. It helps to extended the table without adding new column in table. Because we can store multiple column values in single column as Hash value. So, It reduce the difficulty of retriving and …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/11/how-to-use-serialized-object-in-active-record-using-rails/

Connect MS SQL Server with Rails

To connect MS SQL Server with Ruby on Rails follow the below steps: SQL Server (2005 or higher recommended) Install the adapters and driver [code] gem install tiny_tds gem install activerecord-sqlserver-adapter [/code] Ensure the activerecord adapter and db driver gems are defined in your Gemfile [code] gem ‘tiny_tds’ gem ‘activerecord-sqlserver-adapter’ [/code]

Permanent link to this article: https://blog.openshell.in/2013/04/connect-ms-sql-server-with-rails/

Unable to create rails application with sqlserver

Could not find “config/databases/sqlserver.yml” in any of your source paths. Your current source paths are: $HOME/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/generators/rails/app/templates Error: Template sqlserver.yml file missing. Solution: Need to update sqlserver.yml file in the specific location to fix this issue. Step1: Download sqlserver.yml configuration file. Step2: Extract the downloaded zip file. Step3: Copy extracted sqlserver.yml configuration file into the location which …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/04/unable-to-create-rails-application-with-sqlserver/

Random Image Rotation in ROR

It’s pretty easy to accomplish random image rotation in ROR. This is a simple example of how it can be done, and of course there are ways to make it better (for example, this snippet will only rotate and display .jpg, .gif, and .png files). First, create a folder – let’s name it “rotate” – …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/01/random-image-rotation-in-ror/

Fixing libmysql.dll issue in Rails

While working on rails with mysql as database you may got error like this “This application has failed to start because libmysql.dll was not found. Re-installing the application may fix this problem” while executing the code ‘rake db:create’. If that so, then fallow the fallowing steps: 1. type the command in the console gem install …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/12/fixing-libmysql-dll-issue-in-rails/

HTML mailto attribute

The HTML mailto is a quick way to add the facility of receiving feedback from visitor on the web site. when the visitor clicked the HTML mailto, It lanuches their email program with new email window. Note: HTML mailto assumes that the visitor has configured an email client (Outlook Express, Netscape Messenger, Thunderbird or any …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/12/html-mailto-attribute/

Tips to inspect the code in Rails

Inspect It inspects the value. It formats the array with square brace, hash with curly braces with arrows between the key value pairs inspecting parameter. Type It identifying the type of the instance variable. Debug It give nice, easy to read inspection of the value and displayed in a formatted way. These are all some …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/tips-to-inspect-the-code-in-rails/

Ruby Symbols Description

Matter related to the old and new Ruby programmer, and Ruby’s symbols are confusing sometimes or always. Smoothly before this, can not get used is pretty. People learn about the Ruby language is often Rubionreiruzu learn from the project. The Rubionreiruzu symbol is everywhere. There really is everywhere. So, pay attention to the concept of …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/ruby-symbols-description/

Debugging Rails

You can always debug your application and get it back on the rails if ever it something goes wrong. You have to check the application log files. See to it that “tail –f” commands are running on the server.log and development.log. Rails will then show debugging and runtime information to these files and debugging information …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/debugging-rails/

Finders are great but be careful

Finders are very pleasant to use, enable you to write readable code and they don’t require in-depth SQL knowledge. But the nice high level abstraction come with a computational cost. Follow these rules of thumb: Retrieve only the information that you need. A lot of execution time can be wasted by running selects for data …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/finders-are-great-but-be-careful/