Langsung ke konten utama

Postingan

Rails select_month and select_year pre populate parameter

Hi all, I want to share to you how to pre populate parameter into your form.
<%= select_month(params[:month].present? ? params[:month].to_i : Date.today.month, {}, {name: 'month'}) %> <%= select_year(params[:year].present? ? params[:year].to_i : Date.today.year, {start_year: 2017, end_year: Date.today.year}, {name: 'year'}) %> I hope this will help you.
Postingan terbaru

Ruby invert hash

Hi all,

This is how to invert hash manually.

path_names = {:glass=>"gelas", :metals=>"", :other=>"lainnya", :papers=>"kertas", :plastics=>"plastik"}new_names = path_names.inject({}) { |h, (k, v)| h[v] = k; h }

The result:

{"gelas"=>:glass, "lainnya"=>:other, "kertas"=>:papers, "plastik"=>:plastics}

Ruby on Rails Elasticsearch - Faraday::ConnectionFailed (Connection refused - connect(2) for "localhost" port 9200)

English: Ruby on Rails logo (Photo credit: Wikipedia) Ruby on Rails can implement Elastic search. I have project that use Elasticsearch to search job. This is my new experience to set up elastic search.
After I run the rails project, I had error

Faraday::ConnectionFailed (Connection refused - connect(2) for "localhost" port 9200)


This is what you have to do

For ubuntu

sudo service elasticsearch start


For OS X

brew info elasticsearch


I hope this help you.


Related articlesQuerying JSON data at the command line with 'jq'Pillars of the Rails Monitoring Stack: 2016 EditionDeploy containers on bare metal with Packet and Cloud 66: Demo

The fundamental to be Ruby On Rails Developer

I would like to share how the important things to know about the fundamentals things to become Ruby on Rails developer. First of all, I would like to share to you about the meaning of developer. Web developer is someone who makes website based on the blue print.

As general rule to become Ruby's developer, you have to be familiar with HTML, CSS, Javascript, SQL,  and Jquery. If you have learned those parts, I believe you can easy to develop website using this framework.

I have been working for a couple years in making website by using rails. I enjoy to work and I love this job even I have spent a lot of time to learn rails such as energy, money, effort, etc. Even though we have worked for many years in rails, we have to learn the fundamentals part to be geek.

Technologies as always improves. Prepare your self to always learn the new technology. That's all for now. Have a good day.
Related articlesRuby on Rails Software Developer at the University of MarylandBuild APIs with Napa

Learning Object of Ruby

It's time to share about learning Ruby as a programming language. I would say, it is not quite hard to learn form basic to know about Ruby itself. As you know Ruby is always to detect everything like object even string. For instance,
2.2.1 :001>"Muhamad Akbar Bin Widayat".length=>2
It is very helpful for someone who wants to know the length character directly. Perhaps, you have been wondering to get more information in this chapter, you can visit the www.codeacademy.com. You will get new experience to learn and practice.

We hope by sharing this code will motivate everyone to learn about new programming language for you. Thanks.

Codeigniter CkEditor Pre populate value in form

Hi,

I have a tips for developer codeigniter to handle prepopulate.

Try this in your form add setData()
<textarea id="pr_description" class="form-control" value="<?php echo set_value('pr_description'); ?> "name="pr_description"></textarea> <script>
  CKEDITOR.replace('pr_description');
  var editorText = CKEDITOR.instances.pr_description.setData("<?php echo set_value('pr_description'); ?>");
</script>  I hope this article useful.

Cara mematikan/restart/reboot/reset tablet evercoss ATG1

Assalamualaikum,

Sesuai dengan forum HP CROS dengan jawaban Bang Qomar Bali.
Cara untuk mematikan, mereset. restart, reboot  tablet evercoss ATG1 yaitu dengan cara.
Tekan dengan jarum atau benda yang bisa masuk ke dalam lubang kecil di dalam tobol lain.

Untuk tablet lain bisa disesuaikan.
Terimakasih semuga bermanfaat