Posts

Showing posts from July, 2017

PREVIEW VIDEO BEFORE SAVING IN RAILS

Preview Video Before Saving html page <h1>HTML5 local video file player example</h1>
<div id="message"></div>
<input type="file" accept="video/*"/>
<video controls autoplay></video>


<script type="text/javascript">
   (function localFileVideoPlayer() {
    'use strict'
    var URL = window.URL || window.webkitURL
    var displayMessage = function (message, isError) {
      var element = document.querySelector('#message')
    element.innerHTML = message
    element.className = isError ? 'error' : 'info'
    }
    var playSelectedFile = function (event) {
    var file = this.files[0]
    var type = file.type
    var videoNode = document.querySelector('video')
    var canPlay = videoNode.canPlayType(type)
    if (canPlay === '') canPlay = 'no'
    var message = 'Can play type "' + type + '": ' + canPlay
    var isError = canPlay === 'no…

RUNNING THE RAILS COMMAND ON SERVER

When we run the rails command on the server then we show the usage and options on the server. We are not able to run the rails commands.
If we want to run the rails commands likes:-

rails g migration ...
rails g controller ...
rails console ....

For that we need to create the bin folder in our project using this command:-

If you're using Rails 4+, regenerate your app's bin/ directory executables: rake rails:update:bin
Please refer the link-

http://stackoverflow.com/questions/28569348/rails-server-not-working-even-though-i-am-in-the-correct-directory