Ruby On Rails : Why do we need to html_safe string? : Why html tags not rendered?

What is html_safe? Why use that? Read this

Lets say, you have a feature in your application such that you have a text-area (Integrated with text-editor plugin) in your form and use can write markups. These markups are supposed to be rendered in the view as HTML Tags (Just like they appeared in TextEditor like CKEditor). Suppose you write Continue reading


Ruby On Rails : Partials : @instance variables unavailable in partials called from view

You might have experienced unavailability of instance variables inside a partial you call from a view template or a partial. Yes, you cannot access instance variable within a partial not rendered directly from a controller action. Continue reading

Ruby On Rails: ActionMailer : Get full URL to an image in a Rails asynchronous mailer

Well this is odd behavior, but I’ve resolved this issue. It turns out that unless the action_mailer.asset_host starts with http:// then it will be ignored. There is a Regex in actionpack/lib/action_view/helpers/asset_url_helper.rb that defines a valid ActionMailer URI:

URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}

However, Continue reading