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
#new.haml | |
-form_for(@webcast, :url=>{:action=>"create"}, :html=> {:id=>"wrf",:multipart => true }) do |f| | |
= f.label :presenter_Name,"Presenter Name:*" | |
= f.text_field :presenter_Name | |
= f.label :presenter_Email,"Presenter Email:*" | |
= f.text_field :presenter_Email | |
#How to pass these non-db values to server in HTTP POST? | |
=select_tag "presenter_name_email[]","",html_options = {:size=>"5", :multiple => true} | |
=button_to_function "Add", "", html_options={:id=>"add"} |
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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript" language="javascript"> | |
$(document).ready(function(){ | |
//If you want to move selected item from fromListBox to toListBox | |
$("#add").click(function() { | |
//$("#fromListBox option:selected").appendTo("#toListBox"); | |
$("#fromListBox").appendTo("#toListBox"); |
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
$(document).ready(function(){ | |
var r=function rem(e){ | |
alert("Hello World"); | |
}; | |
$("#remove").click(r); | |
}); |
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
[myxml] | |
<item> | |
<title>Book1</title> | |
<author>Bob</author> | |
<link>http://url1.com</link> | |
</item> | |
<item> | |
<title>Book2</title> | |
<author>Bob</author> | |
<link>http://url1.com</link> |
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
I have the following XML doc: | |
<objects> | |
<item> | |
<title>book1</title> | |
<link>http://asdf.com</link> | |
<pubDate>march 1 2009</pubDate> | |
<description>testtesttest</description> | |
<media:thumbnail url='http://url.com' /> | |
</item> | |
<item> |
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 index | |
@site=Site.new | |
end | |
-form_for @site, :url=>{:action=>:create} do |f| | |
=f.error_messages | |
=f.label :original_address | |
=f.text_area (:original_address,:size=>"100x20") | |
=f.submit "GeoCode" |
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
class Peripheral < ActiveRecord::Base | |
has_many :quotes, :order=>"peripheral_id" | |
end | |
class Quote < ActiveRecord::Base | |
belongs_to :peripheral | |
end | |
def admin | |
session[:item]=params[:val] |
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
# | |
# | |
# | |
# | |
# | |
require 'rubygems' | |
require 'win32ole' | |
require 'csv' | |
mdb_file="c:/dtolj/ruby_projects/phone.accdb" |
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
scope "/geosites" do | |
root :to => "sites#index" | |
end | |
$rake routes | |
sites_index GET /sites/index(.:format) {:action=>"index", :controller=>"sites"} | |
root /geosites(.:format) {:action=>"index", :controller=>"sites"} | |
http://mysite.com/geosites | |
No route matches "/" |
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
gem install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --with-mysql config=/usr/lib/mysql/mysql_config |