<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title><![CDATA[SitePoint Forums - Ruby & Rails]]></title>
		<link>http://www.sitepoint.com/forums/</link>
		<description><![CDATA[Get up to speed with this Object Oriented scripting language, Ruby, and the full-stack framework that's provided by Rails. Share tips and get help with your scripts.]]></description>
		<language>en</language>
		<lastBuildDate>Sun, 19 May 2013 13:43:24 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.sitepoint.com/forums/images/sitepoint/misc/rss.png</url>
			<title><![CDATA[SitePoint Forums - Ruby & Rails]]></title>
			<link>http://www.sitepoint.com/forums/</link>
		</image>
		<item>
			<title>PROBLEMS CREATING AN SSH TUNNEL</title>
			<link>http://www.sitepoint.com/forums/showthread.php?1056559-PROBLEMS-CREATING-AN-SSH-TUNNEL&amp;goto=newpost</link>
			<pubDate>Tue, 07 May 2013 18:07:21 GMT</pubDate>
			<description><![CDATA[Hello, 
  I'm writing a series of test that test credit cart transactions and our card service relies on communicating to a sabrix server through an ssh tunnel. 
I've created something that works but I have to admit, it doesn't make sense because I'm using a combination of a unix exec call and...]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
  I'm writing a series of test that test credit cart transactions and our card service relies on communicating to a sabrix server through an ssh tunnel.<br />
I've created something that works but I have to admit, it doesn't make sense because I'm using a combination of a unix exec call and Net::SSH::Gateway.<br />
In order for the ssh tunnel work with the tests to to work they HAVE to work in conjunction to each other.  I'm ok with it but it seems like 1 out of 10 times, the tests will fail because the ssh tunnel isn't open for some reason.   I've tried about every solution out there but can't seem to get anything else to work.    Here's the code:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; def setup<br />
&nbsp; &nbsp; super<br />
&nbsp; &nbsp; @controller = AccountController.new&nbsp; &nbsp; <br />
&nbsp; &nbsp; @pid = fork{ exec(&quot;ssh -N -L 8888:10.0.1.68:8080 test@test.test.com&quot;) } #this has to be open in a thread<br />
&nbsp; &nbsp; @gateway = Net::SSH::Gateway.new('test.test.com', 'deploy')&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #this has to be created as well<br />
&nbsp; &nbsp; sleep(1) #sleep just a tad to let everything start up<br />
&nbsp; end<br />
<br />
&nbsp; def test_update_credit_card_info<br />
&nbsp; &nbsp; #test code here…<br />
&nbsp; end</code><hr />
</div>And in my teardown method, I'm killing the ssh tunnel like this:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; def teardown<br />
&nbsp; &nbsp; system(&quot;kill -9 #{@pid}&quot;) #kill by pid<br />
&nbsp; &nbsp; @gateway.shutdown!&nbsp; &nbsp; &nbsp; &nbsp; #kill the Net::SSH::Gateway instance<br />
&nbsp; end</code><hr />
</div>Any ideas?<br />
<br />
Thanks,<br />
Eric</div>

]]></content:encoded>
			<category domain="http://www.sitepoint.com/forums/forumdisplay.php?227-Ruby-amp-Rails"><![CDATA[Ruby & Rails]]></category>
			<dc:creator>clem_c_rock</dc:creator>
			<guid isPermaLink="true">http://www.sitepoint.com/forums/showthread.php?1056559-PROBLEMS-CREATING-AN-SSH-TUNNEL</guid>
		</item>
		<item>
			<title>Rails Transaction - Validations Not Rendering</title>
			<link>http://www.sitepoint.com/forums/showthread.php?1050084-Rails-Transaction-Validations-Not-Rendering&amp;goto=newpost</link>
			<pubDate>Tue, 30 Apr 2013 17:16:16 GMT</pubDate>
			<description><![CDATA[When I run my transaction, it doesn't throw my errors partial displaying that amount can't be string characters, they have to be integers.  Not sure why this is the case, any ideas?  My errors works on my other controllers, but on my transaction code. 
 
 
Code: 
--------- 
Payments Controller 
 
 ...]]></description>
			<content:encoded><![CDATA[<div>When I run my transaction, it doesn't throw my errors partial displaying that amount can't be string characters, they have to be integers.  Not sure why this is the case, any ideas?  My errors works on my other controllers, but on my transaction code.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Payments Controller<br />
<br />
&nbsp; def create<br />
&nbsp; &nbsp; @debt = current_user.debts.find params[:debt_id]<br />
&nbsp; &nbsp; @payment = @debt.payments.build params[:payment]<br />
&nbsp; &nbsp; @payment.user_id = current_user.id<br />
&nbsp; &nbsp; if @payment.save_and_update(@debt)<br />
&nbsp; &nbsp; &nbsp; redirect_to @debt<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; render 'debts/show'<br />
&nbsp; &nbsp; end<br />
&nbsp; end</code><hr />
</div><div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Payment Model<br />
&nbsp; attr_accessible :amount<br />
&nbsp; <br />
&nbsp; validates :amount, presence: true, :numericality =&gt; true<br />
&nbsp; <br />
&nbsp; belongs_to :debt<br />
&nbsp; <br />
&nbsp; def save_and_update(debt)<br />
&nbsp; &nbsp; self.transaction do<br />
&nbsp; &nbsp; &nbsp; self.save<br />
&nbsp; &nbsp; &nbsp; debt.update_attributes(amount: debt.amount - self.amount)<br />
&nbsp; &nbsp; end<br />
&nbsp; end</code><hr />
</div><div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Routes<br />
<br />
&nbsp; resources :debts do<br />
&nbsp; &nbsp; resources :payments<br />
&nbsp; end</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.sitepoint.com/forums/forumdisplay.php?227-Ruby-amp-Rails"><![CDATA[Ruby & Rails]]></category>
			<dc:creator>telagraphic</dc:creator>
			<guid isPermaLink="true">http://www.sitepoint.com/forums/showthread.php?1050084-Rails-Transaction-Validations-Not-Rendering</guid>
		</item>
		<item>
			<title>Slick Mortgage Calculator</title>
			<link>http://www.sitepoint.com/forums/showthread.php?1045597-Slick-Mortgage-Calculator&amp;goto=newpost</link>
			<pubDate>Fri, 26 Apr 2013 18:10:12 GMT</pubDate>
			<description><![CDATA[Hi there, 
 
I want to make a mortgage calculator that is very slick and updates a visual graph live as you change your entries. example: 
 
Attachment 62047 (http://www.sitepoint.com/forums/attachment.php?attachmentid=62047) 
 
I'm not a programmer. How hard would this be to do / is it even...]]></description>
			<content:encoded><![CDATA[<div>Hi there,<br />
<br />
I want to make a mortgage calculator that is very slick and updates a visual graph live as you change your entries. example:<br />
<br />
<a href="http://www.sitepoint.com/forums/attachment.php?attachmentid=62047&amp;d=1366999764"  title="Name:  calc.jpg
Views: 11
Size:  43.2 KB">calc.jpg</a><br />
<br />
I'm not a programmer. How hard would this be to do / is it even possible? Assuming that the actual calculator/formula is known.<br />
<br />
<br />
thanks</div>


	<div style="padding:10px">

	

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<ul>
			<li>
	<img class="inlineimg" src="http://www.sitepoint.com/forums/images/sitepoint/attach/jpg.gif" alt="File Type: jpg" />
	<a href="http://www.sitepoint.com/forums/attachment.php?attachmentid=62047&amp;d=1366999764" target="_blank">calc.jpg</a> 
(43.2 KB)
</li>
			</ul>
			</fieldset>
	

	

	</div>
]]></content:encoded>
			<category domain="http://www.sitepoint.com/forums/forumdisplay.php?227-Ruby-amp-Rails"><![CDATA[Ruby & Rails]]></category>
			<dc:creator>awkward_clam</dc:creator>
			<guid isPermaLink="true">http://www.sitepoint.com/forums/showthread.php?1045597-Slick-Mortgage-Calculator</guid>
		</item>
		<item>
			<title>which one is better</title>
			<link>http://www.sitepoint.com/forums/showthread.php?1043899-which-one-is-better&amp;goto=newpost</link>
			<pubDate>Thu, 25 Apr 2013 10:18:24 GMT</pubDate>
			<description>I own a web design firm and most of the time for any development projects we use PHP and mysql 
 
In recent projects one of my friend told me that ruby and rail is a very good platform and have a very professional community to support for any help needed. 
 
I have php developers working for me but...</description>
			<content:encoded><![CDATA[<div>I own a web design firm and most of the time for any development projects we use PHP and mysql<br />
<br />
In recent projects one of my friend told me that ruby and rail is a very good platform and have a very professional community to support for any help needed.<br />
<br />
I have php developers working for me but i am not sure if i should switch to ruby and rail<br />
<br />
I have seen some very big websites are designed and developed in ruby and rail.<br />
<br />
Is it very good as compared to Php and mysql and can it be install on any server like PHP&gt; I do not want clients to spend money to buy some very expensive hosting later.<br />
<br />
Also if it is too good than I will think of hiring ruby and rail developer.<br />
<br />
I am mainly looking for long term solution so ready to switch if it is too good as compared to other solutions available</div>

]]></content:encoded>
			<category domain="http://www.sitepoint.com/forums/forumdisplay.php?227-Ruby-amp-Rails"><![CDATA[Ruby & Rails]]></category>
			<dc:creator>jeff23</dc:creator>
			<guid isPermaLink="true">http://www.sitepoint.com/forums/showthread.php?1043899-which-one-is-better</guid>
		</item>
		<item>
			<title>How to access the data on a dropdown list in excel using WIN32OLE in ruby</title>
			<link>http://www.sitepoint.com/forums/showthread.php?1042892-How-to-access-the-data-on-a-dropdown-list-in-excel-using-WIN32OLE-in-ruby&amp;goto=newpost</link>
			<pubDate>Wed, 24 Apr 2013 11:22:22 GMT</pubDate>
			<description><![CDATA[I want to programatically choose one of the options available in a Excel Dropdownlist. To manipulate the worksheet I'm using win32ole on ruby. It works well until I try to change the value of the dropdownlist. 
 
I simply don't know how and google has been of no help. 
 
setting a value to a a cell...]]></description>
			<content:encoded><![CDATA[<div>I want to programatically choose one of the options available in a Excel Dropdownlist. To manipulate the worksheet I'm using win32ole on ruby. It works well until I try to change the value of the dropdownlist.<br />
<br />
I simply don't know how and google has been of no help.<br />
<br />
setting a value to a a cell is as simple as worksheet.Cells(x,y).Value=new_value. This is not choosing one of the alternatives available on the dropdownlist and it's not even possible since the cell in question is protected.<br />
<br />
The protection doesn't stop me from changin the value manualy via excelso I figure there must be a method or functon somewhere that allows me to simulate this action aswell.<br />
<br />
Help in advance for any suggestions.</div>

]]></content:encoded>
			<category domain="http://www.sitepoint.com/forums/forumdisplay.php?227-Ruby-amp-Rails"><![CDATA[Ruby & Rails]]></category>
			<dc:creator>Afroman</dc:creator>
			<guid isPermaLink="true">http://www.sitepoint.com/forums/showthread.php?1042892-How-to-access-the-data-on-a-dropdown-list-in-excel-using-WIN32OLE-in-ruby</guid>
		</item>
		<item>
			<title>Javascript with ruby on rails</title>
			<link>http://www.sitepoint.com/forums/showthread.php?1040070-Javascript-with-ruby-on-rails&amp;goto=newpost</link>
			<pubDate>Sun, 21 Apr 2013 21:20:37 GMT</pubDate>
			<description>Hello all! 
 
I am new to Ruby on Rails and AJAX and I am curious as to the best way to achieve the following: 
 
I have an index.html.erb file that lists some records. 
 
In this page I have some checkbox buttons. When these buttons are checked or unchecked, a javascript array is updated. 
 
...</description>
			<content:encoded><![CDATA[<div>Hello all!<br />
<br />
I am new to Ruby on Rails and AJAX and I am curious as to the best way to achieve the following:<br />
<br />
I have an index.html.erb file that lists some records.<br />
<br />
In this page I have some checkbox buttons. When these buttons are checked or unchecked, a javascript array is updated.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">var selected = [];</code><hr />
</div><br />
When my checkboxes are toggled a <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">filterchanged()</code><hr />
</div>) javascript function is called that does the following ruby code to update the elements on the page (hides and shows elements without refreshing the page or using a controller<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp;  &lt;% Post.recent(**selected = []**).each do |post| %&gt;<br />
&nbsp; &nbsp; &nbsp;  ... retrieve data from database and hide/show elements<br />
&nbsp; &nbsp; &lt;% end %&gt;</code><hr />
</div><br />
I understand that since javascript runs on the client and ruby on the server, I can't pass a js variable to ruby but how can I achieve the intended result?<br />
<br />
Thank you.</div>

]]></content:encoded>
			<category domain="http://www.sitepoint.com/forums/forumdisplay.php?227-Ruby-amp-Rails"><![CDATA[Ruby & Rails]]></category>
			<dc:creator>Ayradv</dc:creator>
			<guid isPermaLink="true">http://www.sitepoint.com/forums/showthread.php?1040070-Javascript-with-ruby-on-rails</guid>
		</item>
	</channel>
</rss>
