New to ROR

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”).generate

Now 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 :confused:

On Wednesday, July 18, 2012 12:56:29 PM UTC+1, Wijnand wrote:

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 :confused:

I’d use something like prawn-rails to write your pdf generation code as
a
view. As would any other view your controller would setup any data you
need
and then the view file itself contains the layout info.

You could even use the usual respond_to stuff so that going to the url
with
.html at the end gets you the html version but changing the suffix to
.pdf
would get you the pdf version.

Fred