config/routes.rb
and add the following lines:http://localhost:3000/
will go to http://localhost:3000/welcome/index
config/initializers/imagekitio.rb
, open it and add your public and private API keys, as well as the URL Endpoint as follows: (You can find these keys in the Developer section of your ImageKit Dashboard)app/controllers/welcome_controller.rb
. Edit it to make it look like the following:app/views/welcome/index.html.erb
file and edit file with text Hello world
. Now refresh the browser it renders the Hello world
.app/views/welcome/index.html.erb
:/welcome/upload
. We need to add this path to our routes. Go to config/routes.rb
, and add the following line:app/controllers/welcome_controller.rb
, and add the following method:upload_file()
API. We also attach an example tag 'hello' to the image.app/views/welcome/index.html.erb
.Gemfile
and add carrierwave gembundle install
app/uploaders/<name>_uploader.eb
, and enter the following code. The options configuration is optional.app/models/post.rb
, and add the following lines:app/controllers/posts_controller.rb
, and add the following methods:app/views/posts/
, and add the following filesconfig/routes.rb
get_authentication_parameters(token = nil, expire = nil)
takes two optional arguments, token
, and expire
. token
defaults to a random string if not provided. expire
defaults to infinite.