Add rich text editor in a rails app

August 13, 2011

0

Hi, I just came across a requirement to add a rich text editor in my web application made in rails. I used TinyMCE for this. I loved the small js based editor not because of the features but because of the customization options it provides. Here I show u a simple way to integrate TinyMCE […]

Posted in: Rails app

Nice JQuery Plugin

August 13, 2011

0

I recently found out a very nice JQuery plugin. http://dipi-graphics.com/labs/6/NavDock-jQuery-Plugin.html I havent tried it yet but will try it soon.. From the demo…its worth a shot !!

Posted in: Leanings, Rails app

Using Gradient in HTML using simple CSS

August 12, 2011

0

In this post I show(after some googling) how to use gradients(color transitions) in your html using simple CSS. I am putting the CSS code below. This code can be pasted in the css file of your project. you have to create a div with id as “gradient”. Alternatively, you can paste this code in style […]

Some Core Rails Helper for Ruby

August 10, 2011

3

The Core Extensions are ActiveSupport’s collection of extensions to Ruby’s core classes and modules. They are basic design patterns solving problems that are encountered often in Ruby. These methods are one level below the Rails API; they are the internal functions that Rails uses. Class:Array–> ————————————————————————————————————————————- Conversions core_ext/array/conversions.rb • Array#to_sentence joins the array’s elements and […]

Posted in: Rails app, Ruby

Programming Language

August 9, 2011

0

The primary purpose of source code should not be expressing implementation to a computer; it should be expressing meaning to people. Programming languages are an incredibly expressive and terse medium for the concepts programmers talk about. Proposals to make programming languages more English-like inevitably fail not because of poor implementation but because there is an […]

Posted in: Rails app, Ruby

Ruby we might Miss

August 9, 2011

0

This is the continuation part of the series I started. The topic for this post : String —————————————————————————————————————— String#%(args) interpolates the arguments into itself in the manner of sprintf. To provide more than one value for interpolation, you must supply an array. “%.5f” % Math::PI # => “3.14159” “%.5f, %.5f” % [Math::PI, Math::E] # => […]

Posted in: Ruby

Ruby we might Miss

August 9, 2011

0

This is the continuation part of the series I started. The topic for this post : Proc —————————————————————————————————————— • Proc#[] is shorthand for Proc.call. p = lambda{|x| x * 2} p[3] # => 6 ——————————————————————————————————————

Posted in: Ruby

Ruby we might Miss

August 9, 2011

0

This is the continuation part of the series I started. The topic for this post : Module —————————————————————————————————————— • Module#remove_method removes a method from the specified class. Module#undef_method, on the other hand, actively prevents that method from being invoked on the class; it inserts a special entry into the m_tbl that stops method lookup. ——————————————————————————————————————

Posted in: Ruby

Ruby we might Miss

August 9, 2011

0

This is the continuation of the series I started. The topic for this post : Kernel —————————————————————————————————————— • Kernel#Array tries to coerce its argument into an array: Array([1,2,3]) # => [1, 2, 3] Array(1..3) # => [1, 2, 3] Array(1) # => [1] ——————————————————————————————————————

Posted in: Ruby

Ruby we might Miss

August 9, 2011

0

This is the continuation of the series I started. The topic for this post : Hash —————————————————————————————————————— • Hash.new accepts a block, which provides a way to calculate a default value if the hash has none. This is useful for caching. The first time a cached method is called with a particular set of arguments, […]

Posted in: Ruby