Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

rails task arguments

namespace :rails_app do
  desc 'task with arguments'

  task :task, [:option1, :option2] => :environment do |_task, args|
    puts 'rails_app:task', args
  end
end

$> rails 'rails_app:task[1,2]
=> work: {:option1=>"1", :option1=>"2"}
Comment

PREVIOUS NEXT
Code Example
Ruby :: ruby replace certain character 
Ruby :: how to add uniqueness in rails migration 
Ruby :: ruby gem dir 
Ruby :: ruby replace first character in string 
Ruby :: ruby iterate over array 
Ruby :: ruby on rails rollback migration 
Ruby :: substring replace in ruby 
Ruby :: head in rails 
Ruby :: ruby each char with index 
Ruby :: ruby make chain method 
Ruby :: edit file terminal mac24 
Ruby :: ruby hash merge 
Ruby :: how to write CSV file in rails 
Ruby :: for loop ruby 
Ruby :: ruby read stdin 
Ruby :: rails array count occurrences of elements 
Ruby :: Rails validations: unique scope 
Ruby :: rbenv and ruby different versions 
Ruby :: rails debug 
Ruby :: ruby array shift 
Ruby :: how to update model rails 
Ruby :: manage ruby versions 
Ruby :: rails g controller with actions 
Ruby :: gem file permission error for ubuntu rails 
Ruby :: run method before rails 
Ruby :: ruby null 
Ruby :: devise trackable not working for authentication 
Ruby :: undefined variable logger rails 
Ruby :: ruby hash from array 
Ruby :: hello world ruby 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =