Monday, October 30, 2017

FIX Dependency failed for /dev/disk/by SWAP

small receipt 4 fixing this annoying error
bla bla bla ...
Dependency failed for /dev/disk/by

in stead of going the full history of what happen ill get to the point this is the most easy way i found


  1. its a VM and configure it to boot an iso in my case hirens
  2. then i pick parted magig
  3. use gparted and delete the swap partition who's causing the problem
  4. remake the swap partitions (apply)
  5. format to swap (apply)
  6. get the UUID
  7. mount RW the partition that holds the /etc 
  8. open /etc/fstab
  9. match UUID from gparted to the one for swap on fstab
  10. reboot 
  11. Done
if this does not work then keep searching :) no bad karma this is what it worked for me 


Monday, March 27, 2017

RAILS Save Form Fields Upcasing them

We can uppercase the forms with several ways but at the time to save the data by default, the form will send the info lower case so upcase the view does not solve the problem we need to work on the controller, or model here it the simple way to do it on model.

First we add the css transformation to upcase the field via class:



Now that we have to put the class in the Field's Form



now that we have the form uppercase the text input its time to work on the model

and that is all, for a better comprension of the upcase! or better understanding on the model part check out statck overflow and ruby guides

Tuesday, March 14, 2017

PDF Rails+Prawn 6 steps 7 images

Edit /Gem file to add prawn


> bundle
now that we have prawn installed its time to add th Prawn class i put it on app/pdf/credential.rb

here we extend the Prawn class where im receiving a subscriptor objecto to get the info from it an build a Pdf from it.

now we have the skeleton and we can work on the layout of the pdf as we want, now we need to let it being accessed from rails and the world, lets define a route


now i set the a link_to helper to access this new route so first check the new route


whith the new route i use it for the link_to helper to access the content


now that we have the link to access the pdf content we need to set it up on the controller so the controller knows what to do with it


basically first we get the object subsctiptor, then in the respondo_to we manage the format.pdf, create the new object Credential passing the object subsctriptor, and the info for the file like the name, type and that we will use a new window