This is my first week of Ruby and ROR and new to this discussiongroup.
I build a pdf generator with prawn. Currently I run it from a run.rb
file
that contains:
PDFGenerator::A5.new(filename: “a5.pdf”,
instructions_header: "Some header", instructions: "Some instructions ", link: "www.someurl.com", experience_header: "Some header", experience: "Some text"
},
photo: “images/img.jpg”,
qr_code: “http://img.from.url”,
logo: “images/logo.png”).generateNow I have no idea, how to execute that file when I press on my generate
button in my rails app:
<%= form_for @assemble do |f| %>
<li style="margin-top: 13px;"><%= f.label :photo %></li> <li><%= f.text_field :text_top%></li> Business card<%= f.check_box :format_business_card %> <div class="span6"> <h2>Example</h2> <p><%= image_tag("a5.png", :size => "420x600") %></p> </div> </div>
<% end %>
I have my files in the appropriate places. But I just don’t ahead from
this.
Model: assemble.rb:
class Assemble < ActiveRecord::Base
attr_accessible :title, :body
end
Controller: assemble_controller:
class AssembleController < ApplicationController
def index
redirect_to new_assemble_path
end
def new
@assemble = Assemble.new
end
end
My apologies if this is the wrong place to ask my question, but I have
been
lost at this for 2 days now and I don’t know how to find the answer on
Google