Why isn't my logo appearing on my partial page in Rails? - ruby-on-rails

I have made a application and the logo appears on every page. All 3 of my layouts are copy and pasted to be identical. I have 2 partials linking to 2 pages in the same view folder and the logo works with one and doesn't with the other. It just displays the "alt" name of the <img>. Is there a way to fix this?

I'd suggest -and I apologise for this- that the obvious answer is that you're not correctly calling the image file.
Check the URI of the image -in the generated (x)html- to make sure that, in the finished page, it's pointing to the correct file. My own issues in these situations tend to be deleting a period (../image.png becomes ./image.png), a typo on the file type (image.png' asimage.pgp` -I don't know why) or some other typo-based issue.
I'm sorry I can't be more technical but those are, in my experience, the most common answers.

Related

Change Jekyll site baseurl without breaking links to existing posts

I have a Jekyll blog using the Minimal Mistakes theme. It's hosted through GitHub Pages, with a custom domain name. The github repo is called eg me.github.io. Currently, the blog is at something like http://www.example.com, so each post comes up like http://www.example.com/trouble-with-urls/.
I want to change it so that it's all at http://www.example.com/blog instead. I have added baseurl: "/blog" to my _config.yml file and now the posts are at the right place, http://www.example.com/blog/trouble-with-urls/. However, I now have two problems: all my image links are broken, and more importantly the links to individual posts are also broken.
Is it possible to automatically redirect posts? I looked at the jekyll-redirect-from gem, but I don't really understand it. It looks like the baseurl is automatically included in the path for the redirect_from: and I can't work out how to ignore it. The readme for that gem says, for customising, "Simply create a layout in your site's _layouts directory called redirect.html." Is there something I can do with that?
Actually I would also like to change the permalinks as well, to add dates, but I'm trying to focus on one problem at a time! Eventually the final URL of each post should be like http://www.example.com/blog/2021/02/13/trouble-with-urls/.
For the images, they are currently all hardcoded like ![url trouble](/assets/images/2021-02/ugh.png). I can fix the path by adding in "/blog", to make it ![url trouble](/blog/assets/images/2021-02/ugh.png) but I think this might be a bad way to link images anyway. I saw that there are {% %} tags for links but can't find any resources about using them for images. Is it possible?
I managed to get this working, so here's what I did in case anyone else tries similar in future.
Adding a baseurl in _config.yml didn't work. Instead, I duplicated my repo, to take advantage of Github Pages' allowance for 1 User site but many Project sites.
One repo remained as me.github.io. I renamed the copy to blog, and added a gh-pages branch. This made GitHub automatically deploy it at me.github.io/blog.
Within the blog repo, I changed the permalinks to the style I wanted. The images were fine as the relative paths hadn't changed.
Within the original me.github.io repo, I first changed the home page (by editing the Minimal Mistakes html files) to hide all posts. Then I added a link at the top of the page to their new home, at me.github.io/blog. The blog is now successfully a subsidiary of the main site.
So that old links wouldn't break, I kept all the existing post files in the me.github.io repo. I used the jekyll-redirect-from gem to add redirects into each post for the new address. This was done by manually adding a line into the Front Matter of each, saying eg redirect_to: http://www.example.com/blog/2021/02/13/trouble-with-urls/. I also deleted all the post content of these posts, so only the Front Matter was left.
All future posts will be made within the blog repo, and so they will have the correct URLs.

Embed PDF in a website, allow user to modify editable fields in PDF, and save back to the server

I am writing a Program in Rub On Rails 4.x and I have to take PDF files with defined fields that can be filled out, fill in data from a form submission(This part is DONE!), and lastly allow the user to modify the saved PDF file on the server and overwrite said PDF after making their modifications.
Like I said I have already gotten the PDF files filled out with what has been submitted in the form through pdftk . What I now need to do is provide a server side editing capability to the said PDF files on server generated from the first step of the process.
I have seen similar posts but none wanting to do the same thing I do. If I am wrong links would be great. Thanks in advance for all your help!
After lots of digging and research here is what I have found to be the facts surrounding this issue and implementing a program to allow embedding the PDF file, editing it, and saving it back to the server. This process would be great however from what I can tell there is nothing out there that really does this for Ruby On Rails. To quote #Nick Veys
Seems like you need to find a Javascript PDF editor you can load your PDF into, allow the user to modify it, and ultimately submit it back to the server. Seems like they exist, here's one for ASP projects
You are correct but still wrong in the sense that yes there is one for ASP projects however that is Microsoft Based, yes I know that it can run on Linux environments through Mono. However to the point it would appear in this instance that a Ruby On Rails specific solution is indeed needed.
The solution that we have come up with is as follows
1. Use a PDF editing package in the linux repositories like PDFtk
2. You then render a page with the PDF embeded on one side and a form representing the live fields in the PDF to take input.
3. Once submitted you use PDFtk to write the values into a new template PDF file and overwrite what was previously stored.
This requires a few additional steps to process the data than I really care for myself. However it is the best solution that our team could come up with, without bleeding the project budget dry for just 1 piece of functionality.
I hope this helps anyone else looking to do the same thing in Ruby On Rails.
I have done something like this using my company's .NET product. It can also be done using its Java version too.
http://www.gnostice.com/nl_article.asp?id=255&t=Save_Form_Submit_Data_Back_To_Original_PDF_Document_In_NET

Transferred site doesn't show content with PMWiki

A relatively simple pmwiki site has been copied to a new server. All of the formatting (non-wiki) code works however the wiki content comes up as blank.
If I add a new page, that page shows up just fine.
I have checked the permissions and ownership of the files in wiki.d folder. All files (new and old) look identical.
I have eliminated the search optimization file in hopes that the old would be treated like the new.
Is there another file that references older files that might be keeping them from being seen? Any ideas would be welcome.
I've never had this problem before in copying a pmwiki site.
Here is the site http://pecarru.mobilify.pw/
Here is the new page http://pecarru.mobilify.pw/index.php?n=Main.NewPage
All pages should have text in the white box
The page-source is available by appending &action=source, so that tells us there is no problem accessing the content.
Additionally, the content looks normal -- no weird characters that I can see (which sometime cause trouble on a new server).
However, I do see "smart quotes" in several pages; try changing changing them to dumb-quotes and see if the page will now render.
I see that the WikiSandbox page and content in the PmWiki group renders, so it's not every page that has a problem.
If editing doesn't resolve the issue, try disabling recipes in \local\config.php until the content appears.
Something is choking on render.

Is the meaning of "/../" - parent directory standard in URLs?

In many filesystems ".." corresponds to parent directory. How is it with URLs? I saw some examples behaving according to this scheme, but is this a standard (RFC)?
Exactly the same.
http://www.mysite.com/dir1/dir2/dir3/index.html
a link to "../../me.jpg" should give you http://www.mysite.com/dir1/me.jpg
The cod red virus that went round a good number of years back attacked IIS sites because c:\inetpub.. was the document root and if you did a url such as /../../../../windows/cmd.exe%20dir it would execute it!
Of course this is a standard http://www.w3.org/Addressing/rfc1808.txt describes it, the segment/.. is removed iteratively from left to right.

osCommerce links to categories taking to a wrong page

I'm modifying a website made with osCommerce (I didn't make this website), and one of the things I have to modify is the look of the home page. My problem is that I have modified the index.php file, and all the changes look fine.
However, when I click a link that has been written in PHP with this function:
<?php echo tep_href_link(FILENAME_DEFAULT,'cPath=24&sort=2a') ?>
(In /includes/filenames.php I have define('FILENAME_DEFAULT', 'index.php');.)
What happens is that it shows the correct results, but in a different page, with the old design. I don't understand it, because that link should take me to the same index.php that I modified, but obviously it's taking me somewhere else.
I don't know what page is it showing, the only thing I see is the link written by the PHP function:
(my_catalog_folder)/escaparate-c-24.html?sort=2a&osCsid=p7fp55t489nv042p0ip4mp7si1
I guess that the tep_href_link() is writing that, but I don't know what page is using to show the results.
Any clues would be much appreciated!
This is expected behaviour if the store has the SEO URLs module installed.
Look in the .htaccess file and you should spot this line:
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
Any and all requests for a category will be rewritten in a friendlier URL string like the one you noted.
As to the use of the older design, double-check the real file being called with an echo out of the $_SERVER["PHP_SELF"]; or $_SERVER["SCRIPT_NAME"]; and make sure the filename and path is correct.
Drop that into a file like includes/application_top.php before the final lines (or the closing ?> if you still have that there):
echo $_SERVER["SCRIPT_NAME"];
It may also be due to caching of the pages. Check to see if there a cache module installed as well.

Resources