How to upload file using Ajax and Rails

Javascript, jQuery, Ruby, Ruby on Rails, 2016-02-12 10:58:00 UTC
In this case, we need a plugin    <form id="the_form" action="/page/gambars/form_upload" method="post" enctype="multipart/form-data"> <div> File<br /> <input name="gambar[gambar_name]" /> </div> <div> <button type="submi
Share:     

Creating Slug With Ruby

Ruby, 2016-01-17 00:46:06 UTC
Today I am dealing with 'slug'.  Yeah, as I know slug term come from Wordpress. Slug mean that downcase character separated by dash. It's something like "i-am-slug". It usually use for URI permalink. Let say I want to convert below string into slug; @tstring = "Hi!, I am Slug" To solve this;
Share:     

Ruby File/Folder Operations

Ruby, 2015-10-04 00:12:41 UTC
file = "/the/path/file_name.wow" file_name = File.basename file # => "file_name.wow" extname = File.extname file # => ".wow" basename = File.basename file, extn # => "file_name" path = File.dirname file # => "/the/path"
Share:     

Rails Debug via Console

Ruby, Ruby on Rails, 2015-06-17 08:18:56 UTC
One thing that is important when we make an application is how we keep tracing the error. Rails framework package by default using Webrick webserver. In the development process, we can see what is happening behind the scenes through a console. We can make the console gives a message that the applic
Share: