I am very very new to Ruby on rails. Just joined as an Intern in a
company. They gave me a task. I want to open the PDF in a new window
based on the location id where we currently in. For example, In a
database table we have a column name location id in one table. PDF's
stored in the server. I want to get the PDF based on the location
id(that might be in a drop down menu). Please help me to do that. I want
some to teach me this concept.
Thank you so much for your reply. I am looking for a online tutor to
teach me through skype and teamviewer. Do u know anyone? I am ready to
pay.
Javier Quarite wrote in post #1073677:
Try working through a tutorial such as railstutorial.org which is free
to use online and will give you the basics or rails. You have not
given us sufficient detail to answer your question directly.
The EPC’s(PDF's) themselves are not stored in the database, this is
because each client can have hundreds of EPCs and we don’t want these to
increase the size of the database, instead we save the EPC’s on the
server and link to them in the database.
To get the path of the EPC you need to get the path out of the database.
This can be done using the following SQL.
Select C."value"||A.epc_file_name
From DBA.enr_rds_xml_datas A
Join DBA.GlobalIniFile B on B.section = 'Paths' and B.ident = 'EPCStore'
Where A.location_id = MyLoCode
And A.is_current = 1;
You might want to look at creating a view for the above SQL and then
creating a Model for it so that you can access the data in Ruby easily.
You will need to create a new page for this as there is no existing one
currently. The EPC that is opened will depend on the location that the
user is currently on. The is_current flag in enr_rds_xml_datas will
ensure that only one EPC is returned for the current location.
Hello, I can help you with your task for three 'coz it simple. I want to practise in English so I think it can be useful for me too. Skype:embeddedcoder.