Skip to content

Instantly share code, notes, and snippets.

gem 'bootstrap-sass'
gem 'select2-rails'
<%= select "invoice_product_code", "invoice_product_code",
@invoice_product_array.each_with_index.map {
|jsondata, index|
[jsondata["invoice_product_code"],
jsondata["invoice_product_code"]]},
{:selected => item["invoice_product_code"]},
:style => "width:110px"
%>
function addItemRowHTML(offsetidentifiervalue)
{
$node = ' \
<%= select_tag "currency",
options_for_select(Country.all.each_with_index.map {
|country, index|
[country["currency_code"],
country["currency_code"]]},
@invoice["data"]["currency"] ),
:style => "width:120px"
$node ='<select id="currency" name="currency" style="width:120px"><option selected="selected" value="KRW">KRW</option>
<option value="USD">USD</option>
<option value="GBP">GBP</option>
<option value="JPY">JPY</option></select> \
';
function closeWin() {
Ti.API.info("closeWin");
$.comms_ta_check.close();
}
function searchTA(e) {
Ti.API.info("searchTA:" + $.fileNoField.value + $.otherNoField.value);
<?php
$_SERVER['SERVER_PORT'] = 80;
/**
* Step 1: Require the Slim Framework
*
* If you are not using Composer, you need to require the
* Slim Framework and register its PSR-0 autoloader.
*
* If you are using Composer, you can skip this step.
*/
<?php
$_SERVER['SERVER_PORT'] = 80;
/**
* Step 1: Require the Slim Framework
*
* If you are not using Composer, you need to require the
* Slim Framework and register its PSR-0 autoloader.
*
* If you are using Composer, you can skip this step.
*/
{"INVPRODA"=>{"name"=>"INV Product A", "description"=>"ABC", "price"=>"100"}, "INVPRODB"=>{"name"=>"INV Product B", "description"=>"BCD", "price"=>"90.50"}, "INVPRODC"=>{"name"=>"INV Product C", "description"=>"CDE", "price"=>"80.50"}, "INVPRODD"=>{"name"=>"INV Product D", "description"=>"DEF", "price"=>"70.55"}, "INVPRODE"=>{"name"=>"INV Product E", "description"=>"EFG", "price"=>"60.11"}, "INVPRODF"=>{"name"=>"INV Product F", "description"=>"FGH", "price"=>"50.23"}, "INVPRODG"=>{"name"=>"INV Product G", "description"=>"GHI", "price"=>"40.45"}}
in controller
def index
@customers = Customer.all
end
in erb
this doesnt work:
<% raw @customers.count %>
<tbody>
<% @customers.first.data.map do |k,v| %>
<tr>
<td><%= k %></td>
<td><%= v["name"] %></td>
<td><%= v["contact_name"] %></td>
<td><%= v["tel"] %></td>
<td><%= country_helper_get_countryname_by_id(v["country"]) %></td>