-1

I'm asking for help as still a newb to Ruby on Rails/Developing...

I decided to use the Bootstrap 3 DateTimePicker gem in my Rails app to create a time sheet I'm working on. My issue is that the code below places the forms at the top of my page in the navbar and I need/want it in the center of the page.

My guess is that it's either an HTML or CSS issue.

I'm pretty sure it's an EASY FIX...

Any help would be greatly appreciated. Thanx

enter image description here Here is the App View I'm getting with the above HTML code

RDavis
  • 17
  • 4

1 Answers1

0

I don't see any Rails stuff here, but I do see html that calls for two divs of 5 columns each, but no row div,and no offsets. Take a good look at Bootstrap's grid system to learn how to center things on a page. I'm afraid your submission does not give enough information for anyone to make an intelligent recommendation.

Tom Connolly
  • 674
  • 1
  • 5
  • 18
  • Sorry. What further info do I need to provide? @user125272 – RDavis Dec 04 '16 at 23:34
  • Is this in a view template in a Rails app? What's the full name of the file you're showing above? It lacks a row div, and if I remember correctly, col divs must be children of a row div. Your layout appears to be for two sections, each five columns wide. If you want those columns centered left to right, make those divs an even number, and subtract that number to arrive at your offset. For example, since there are always 12 columns in a layout, you would have – Tom Connolly Dec 05 '16 at 00:34
  • ...you would have
    then
    then a close div and a new row div and a new col div.
    – Tom Connolly Dec 05 '16 at 00:42
  • The code I screenshoted above came from http://eonasdan.github.io/bootstrap-datetimepicker/#linked-pickers – RDavis Dec 05 '16 at 01:08
  • I installed the gems the exact way instructed and when I copied the code above, it placed the form content all the way at the top of my page and not in the center. – RDavis Dec 05 '16 at 01:09
  • There's no ruby in that snippet, only html and javascript. The word gem in our context usually refers to a ruby library. Y – Tom Connolly Dec 05 '16 at 01:24
  • This is not a gem. It's a snippet of html and javascript, and nowhere does it indicate it wants to be centered. Do you have a Rails application? – Tom Connolly Dec 05 '16 at 01:55
  • Yes, this is a Rails application. I was saying in my previous comment that before I applied the code above to my app, I followed the instructions of https://github.com/TrevorS/bootstrap3-datetimepicker-rails and installed the Ruby gems needed for the DateTimePicker. But, now that I have done all of that, I'm having trouble centering the content of the DateTimePicker. @user125272 – RDavis Dec 05 '16 at 15:56
  • Again, the snippet supplies you with the datepicker but does not dictate how you display it on the page. That's a different discipline, mostly html and css and nothing to do with the gem. See my note above about rows and columns and divs. Do you have other pages in the app that display the way you want them to? I'm happy to lend you a hand; you have to do your part. – Tom Connolly Dec 07 '16 at 04:57