This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <% if @purchase_order %> | |
| $("div.remote_<%= @counter %>").text("done"); | |
| <% else %> | |
| <% if @params['vendor_name'] == "Enter the vendor's name" || @params['purchase_order'].nil? %> | |
| $("#vendor_name").focus(); | |
| $("#error_<%=@counter%>").after('<span class="error">Vendor is required.</span>'); | |
| <% end %> | |
| <% @params['cb3_ids'].each do |cb3_id| %> | |
| <% %w{quantity unitsize price bt tcost}.each do |word| %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_po | |
| provides :js | |
| po = params[:purchase_order] | |
| # do the creating job for the po | |
| render | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript" > | |
| jQuery.ajaxSetup({ | |
| 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} | |
| }); | |
| jQuery.fn.submitWithAjax = function() { | |
| this.submit(function() { | |
| $.post(this.action + '.js', $(this).serialize(), null, "script"); | |
| return false; | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <% @pos.each |purchase_order| do %> | |
| <%= form_for(purchase_order, :action => url(:create_po_purchasing_shopping_lists)) do %> | |
| <%= hidden_field :name => "counter", :value => count %> | |
| <%= partial 'purchasing/purchase_orders/basic_form', :po => po %> | |
| <button class="positive" type="submit"> | |
| <img alt="create" src="/images/icons/tick.png"></img> | |
| Create | |
| </button> | |
| <% end =%> | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " all credits to antoine, | |
| " more details see: http://blog.ant0ine.com/2007/03/ack_and_vim_integration.html | |
| function! Ack(args) | |
| let grepprg_bak=&grepprg | |
| set grepprg=ack\ -H\ --nocolor\ --nogroup | |
| execute "silent! grep " . a:args | |
| botright copen | |
| let &grepprg=grepprg_bak | |
| endfunction | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| z1 = Zoo.all(:condition.....) | |
| z1.to_yaml # this OK | |
| z2 = Zoo.all(:condition...) | |
| z2.to_yaml # this OK | |
| z3 = z1 + z2 | |
| z3.to_yaml # bam!. ERROR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| zooo = Zoo.all | |
| File.open('zoo.yaml', 'w'){|f| f.puts zooo.to_yaml} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # dm 0.9.8 breaks YAML.dump | |
| zooo = Zoo.all | |
| File.open('zoo.yaml', 'w'){|f| YAML.dump(zooo, f)} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # setting the env to development | |
| RackEnv development | |
| <VirtualHost *:80> | |
| ServerName app.myapp.com | |
| DocumentRoot /Users/zhonghai/apps/ruby/current/public | |
| </VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| ServerName app.myapp.com | |
| DocumentRoot /Users/zhonghai/apps/ruby/current/public | |
| # setting the env to development | |
| RackEnv development | |
| </VirtualHost> |