Posts

Showing posts from May, 2012
In order to upload multiple file to the server the basic thing what we require is multiple file fields. we can do it easily in .erb file with the help of javascript. So just follow the steps and have fun. Step 1 :  create a simple html div for it.                 <div class="apply_div  " id="number_of_download_filed" >        <div class="attachment_div_text" id='div_attached_1'>Add Attachment,</div> <div class="attachment_div_field" id="div_attached_field_1"> <input id='attached_1' type='file' name='attached_1' class='event_action_attach_fields input_file_class'> </div>             </div>            <div class="apply_div ">                              <%= button_tag ' Attach another file ',  :type => 'button',  : class="attach_another_file_button"   %>             </div>

Video chat in rails 3

Video streeming is always a challenge for the rails programmer. I am sure After reading this article  every one CAN DO IT EASILY.  :) Gems used:       gem 'raydash', '2.1.0'       gem 'jquery-rails' Step 1 :       First generate a new rails project by typing rails new Demo_apps. Step 2:    Inside Your gem file add the raydash gem. You can check the version from rubygems.org. Step 3:    Go to http://www.raydash.com/ and generate Your user_id, and secret. Step 4:    Configure Demo_apps with your user_id and secret with the command:     rails g raydash:install [userid] [secret]       or you can directly go to config/initilizer and create a raydash.rb file                       and add your credentials there.     Step 5:            Create an suitable controller and add this       @token = Raydash.getToken()           Step 6:          for the view page write this            

Customize File Uploading button in all browser

It is  a great challenge to customize file uploading button in browsers. So that it will look same in all browser. First thing is some how  you have to replace the file uploading button with some image. for that you just need some css and javascript and few image. So with out wasting a  min lets start . :) Step 1. first Include the javascript file in the page or application or application where ever you want. Step 2 .  Include the required css file. Now the big challenge is to customize the js and css file. Basically For mozila its a great challenge. because it takes the file field size depending upon the font size.  for that in the .js file just do one thing. in the below metioned function change in  the .js.  .mousemove(function(e){ fileInput.css({ 'left': e.pageX - upload.offset().left - fileInput.outerWidth() + 20, //position right side 20px right of cursor X) 'top': e.pageY - upload.offset().top - $(window).scrollTop() - 3 }); })