It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm about to start development of an application with Ruby on Rails, which requires to print stuff, mostly tickets.
I'm guessing the printer I use won't have much impact.
So the question is, what are the different things I should take into consideration with the printing? I'm thinking a normal ruby program should have communication with a printer.
The most portable solution here is for your Rails application to emit a PDF and then hand that off to either the browser for rendering and printing, or to inject it into a local print spooler.
There are a number of ways to get PDF out of Ruby depending on your requirements. The easiest method is to render HTML and use a library to convert it to PDF like PDFKit. A method with more control is one where you draw out the document using a library like Prawn.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I want do use some of my own converter from html table to xls table, but I don't know where to start. The google don't show me comprehensive results. I know about Apache tika and poi, but do they have something easy to build converter? I used to read POI docs but it's just says about converting from xls-to-html most of time. What you will suggest to read. Where to search? Thank you.
It's a two-step process. I'd advise you to keep them separate.
Scrape and parse HTML to get table data
Write table data into Excel.
If the HTML is XHTML your life gets better: All you need is an XML DOM parser and some code to find the node at the root of the tree with the data.
I prefer Andy Khan's JExcel to POI. I think it's far better for dealing with Excel.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am looking to make my first ruby - based website.
I am assuming looking at tutorials that print "hello" should work, but it does not.
Any pointers? I am assuming this is a silly noob question.
my file is located on mysite.com/test.rb
thanks!
(this is more of a dummy starter question than coding, so it is here rather than stack).
Have a look at Sinatra. You can get a hello world site up in 5 lines of code, and then start checking out tutorials from there.
Check out Ruby on Rails resource http://ruby.railstutorial.org/ruby-on-rails-tutorial-book. It is very easy to start learning.
If your file only contains the following
print "hello"
then it most certainly wont just work by browsing to site.com/foo.rb
You need things setup like a webserver to handle the request and route it to a ruby interpreter, etc...
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am using an extension that depends on the page. I would like to use the extension for each board which means I need a board unique url. It currently looks like this
http://phpbb-site.com/forum/viewforum.php?f=BOARDNUMBER
I'd like to trick Firefox into having BOARDNUMBER in the location part of the url.
Then the extension will work and I won't have to tweak it. The problem is that I can't think of any way I can have Firefox use nice urls. I only need it to work on my computer. I don't own the site. What can I do? Can I use a proxy program? I was thinking maybe I could write a quick asp.net program which essentially does a GET request on the site and replaces all links to include the boardnumber and ignores that part of the url when making the request. It's probably a bad idea because I am sure lots can go wrong
Any ideas?
You should be able to do this using a simple script in Fiddler.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I programmed in php. And when you use some framework, then, as far as php is intepreter, all the framework loads every request. But not rails, though, ruby is interperter too... So, how does it work
Nope. Rails as the framework caches all loaded modules, class and libraries on the first several requests (it's not on the first request only since it also has lazy load for above things).
But by default under development mode, all app modules (mvc) are reloaded on each request. Libraries (plugins, gems, etc) are not reloaded.
Your question is hugely wide open and too large to really answer effectively. This is a good place: RoR Guides. If after reading that you have more specific and directed questions bring them back and we'll try our best to help you...
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Anyone done this in MVC? any info would be great!.
Thanks.
You can get pretty far simply by including a print.css file for media type print.
Hide everything you don't want and include logical page breaks and demensions (inches, etc... actually format more correctly using the print.css override).
I have used a custom controller (or filter) to handle links using something like index.print instead of index.html, which simply overrides the master layout with a layout more suitable for printing, but I still feel that the alternate stylesheet is the best way to go.
http://www.alistapart.com/articles/goingtoprint/
Printing a page isn't really a matter for ASP .NET or MVC. Printing is a client-side operation, and therefore can (and should) be done entirely in client-side code. JavaScript has a method call for this:
window.print()