GithubHelp home page GithubHelp logo

urvin-compliance / caracal-rails Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 11.0 36 KB

Caracal-Rails is a drop in solution for registering the Microsoft Word mime type and for establishing a template handler in Rails for the :docx format. It also provides a helper method for accessing the document object which currently has context.

License: MIT License

Ruby 74.49% JavaScript 2.72% CSS 2.80% HTML 19.99%

caracal-rails's People

Contributors

emp823 avatar jdugan avatar jdugan-plia avatar maxhudson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

caracal-rails's Issues

Specify what template to render?

Hello!

Is it possible to specify a template and path to render?
Something like...

format.docx do 
    headers["Content-Disposition"] = "attachment; filename=\"filename.docx\""
    render docx: "path/to/layout.docx.caracal"
end

Or do we have to implicitly use the file at path apps/views/controller_name/action_name.docx.caracal?

Thanks for making it easier to bring the awesomeness of Caracal to rails! :D

Access Number Helpers in Caracal

'I'm trying to access helpers inside the caracal template. However I'm getting an error telling me that the method does not exist. Is there any way i can access the number_to_currency helper in the docx.caracal template?

Error in using caracal in rails 5

I use it in my rails project but when i'm try this example i'm getting error this
undefined method `keep_if' for "Droid Serif":String do you have any idea about this?

Interpolation for docx.p do block

I am attempting to string together an object attribute and a sentence within the do block using text. For some odd reason, it says that the class is nil when I use instance variables inline

docx.p do
   text 'hello' @user.name  
end

How would you approach this issue?

Deprecation warning with Rails 6

Using caracal-rails with Rails 6 leads to the following deprecation warning:

DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
  >> Caracal::Rails::TemplateHandler.call(template)
To:
  >> Caracal::Rails::TemplateHandler.call(template, source)

Example has outdated parameters for caracal methods

The example in the read.me has outdated usage of Caracal methods.

tested replacing caracal-example by this code, fails with undefined method "keep_if" on line 1, because docx.font expect a hash of options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.