Does ruby gem caracal have an option for subscript? - ruby-on-rails

I was going through the documentation for caracal gem in ruby, i noticed that it had the option for superscript tags, but could not find one for subscript, any ideas?

Related

Which Prawn gems should I install for my rails app for creating a PDF?

Hi I have an app which needs to render a PDF with access to controller variables like in view, and ideally also allow me to use partials. Currently I just have installed:
gem 'prawn'
gem 'prawn-table'
These work quite well, except for the fact that they do not allow for using partials.
After some reading I found some wrapper gems such as prawn-rails, prawn_rails (!) and prawnto or prawnto_2.
Does anyone have any experience with these gems and has a strong preference for any?
My Rails version: Rails 4.2.4

Haml for rails, Use 'haml' gem alone or with 'haml-rails'

I am making the switch to Haml for our rails 3.1 application, and I wonder what is bringing to the table by the 'haml-rails' gem against 'haml' alone, apart rails generators?
It says that it preloads the haml in rails process. Does it means a lot of benefits in performance? We are mixing erb and haml so it doesn't seems to be so good to preload every time the haml library.
Thanks!
I use haml-rails primarily to make the generators output haml views instead of erb. Beyond that, I'm not aware of any difference.

How to use ruby libraries in rails?

I just installed a ruby gem
gem install anemone
But I cannot hit off to use it directly in my rails application, this is the first time I'm using an external ruby library so it will be very helpful if you can give me an insight into it rather than just a solution
Cheers
In your Gemfile add:
gem 'anemone'
This way Rails will load the library when it starts, and you can then use it. You don't even have to use the require keyword.
You must put used libraries into Gemfile. Everything about gemfiles is available on Bundler page.
There's an official Rails guide about this topic.
You also need to use 'require' and the name of the library on top of the file where you want to use the library. For example if you are using nokogiri you would need to add the line require 'nokogiri'

What's the right way to add haml to a rails application?

While looking for a way to add haml as the templating engine to my rails app I came upon two distinct ways to do it.
The first one is to just add 'gem "haml-rails"' to the Gemfile.
The second one is to add this code to config/application.rb:
config.generators do |g|
g.template_engine :haml
end
Is there a reason to prefer one over the other?
I prefer the gem because it adds the generators.
Update: The 'haml-rails' gem provides the generators. You'll still need to set the template_engine to haml if you want haml templates by default.
You add your gems into the Gemfile in order to specify external dependencies.
Without adding haml to your Gemfile, Bundler will not know about it and your Haml templates won't render on machines that do not have haml installed.
Just follow the instructions of the documentation... http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#plugin
Or is there a reason to deviate from the recommended way?

Creating my own PaperClip GEM? for Heroku?

based on the needs of my app, I need to make a modification to paperclip, it's only one line but it makes all the difference for my apps needs.
In my Rails 3 GEM FILE I have the following:
gem 'paperclip', '2.3.5'
With github, how does one go about making there own paperclip GEM? So I can use it on Heroku?
Something like
gem 'paperclip', '2.3.5' -> my version?
Would love to hear how this is done. How this is maintained as paperclip is updated. and how I use this locally and on Heroku.
Thanks
Here's the github page on 'Forking'. http://help.github.com/forking/
You must fork the repo on github. Then, instead of passing a version in the Gemfile, pass the following:
gem 'paperclip', :git=>'git://github.com/username/repo.git'
Why are you creating a gem for this? You can monkey patch the gem. This will allow you to use the standard version. What is the change you need? What is the link to your gem, may be there is an easier solution.

Resources