[Rails] Re: Re: rubygems Problem on ubuntu 10.04

2013-11-07 Thread wu volity
Colin Law wrote in post #1125699:
 On 26 October 2013 09:05, wu volity li...@ruby-forum.com wrote:
 I need your help,Please..What is the meanning of '205.251.203.201' in
 '205.251.203.201 production.cf.rubygems.org'.

 It is an ip address.  At one time it may have been (or may still be,
 but I suspect not) a valid ip address for production.cf.rubygems.org.
 But since the email you got this from is two years old it may no
 longer be valid.

 Perhaps if you explained what your actual problem is (preferably in a
 new thread rather than an ancient one) someone may be able to help.

 Colin

Thanks!

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/09fd3716292093a694f20c1a2a0a607a%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Re: Re: rubygems Problem on ubuntu 10.04

2013-11-07 Thread Jordon Bedwell
 Colin Law wrote in post #1125699:
 On 26 October 2013 09:05, wu volity li...@ruby-forum.com wrote:
 I need your help,Please..What is the meanning of '205.251.203.201' in
 '205.251.203.201 production.cf.rubygems.org'.

 It is an ip address.  At one time it may have been (or may still be,
 but I suspect not) a valid ip address for production.cf.rubygems.org.
 But since the email you got this from is two years old it may no
 longer be valid.

 Perhaps if you explained what your actual problem is (preferably in a
 new thread rather than an ancient one) someone may be able to help.

I believe that's a production IP for CloudFront so it should in theory
be valid for RubyGems still but that line as it's printed in the
quotes look like a hosts file line, perhaps somebody trying to stick
the region?

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAM5XQnwvZHUO4f8GpoUw4K4aGFfAWTvQA8OLNrUkh-WFo6%3DgXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: heroku rake db:drop error PG::Error: FATAL: permission denied for database postgres

2013-11-07 Thread Raj Kiran Bhogaraju
Please follow:

http://stackoverflow.com/questions/4820549/how-to-empty-db-in-heroku

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5f7dcd761946eac4c0988e40c52705bd%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Ruby on Rails for Beginners

2013-11-07 Thread Ben Curren

Hi,
Every now and then I see people asking about the best way to learn Ruby...
Checkout Getting Started with Ruby on 
Railshttp://www.skillsin.com/blog/?p=515 with 
several recommended Ruby tutorials.

Regards, Ben 

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/f9ab5816-dfdf-45ab-b13b-0d94bc252178%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: can anyone please suggest me from where I need to start learning ruby on rails..??

2013-11-07 Thread Ben Curren

Hi,
Checkout Getting Started with Ruby on 
Railshttp://www.skillsin.com/blog/?p=515post with great pointers to 
recommended tutorials.

Regards, Ben


On Monday, November 4, 2013 3:13:29 PM UTC+2, Ramamohan Raju wrote:

 Hello,
 I am new to ruby on rails, 
 can anyone please suggest me from where I need to start learning ruby on 
 rails..?? and which IDE is preferred for this..??
 Thank you..!!


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/cb024b06-4e8d-4a5b-b4f5-ce5eede1f00d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: Twitter and Facebook Integration

2013-11-07 Thread andreo
Updating rails is not an option?

Well you should try to use oauth and write an interface for using both 
authentications. would make your life much easier.

What do you use for normal authentication?

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/305851fb-6c55-4249-852f-fdfa1f6c8e0f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Free ad space if you donate to RVM

2013-11-07 Thread Karthikeyan A.K
Hello People,

I am very much fond of rvm http://rvm.io/ . All the apps I have deployed
runs on it. RVM needs funding so that it can be developed further. I want
to hasten the process of funding.

I have written a ruby programming book named ‘I Love Ruby’ thats totally
free, you can get it here http://goo.gl/FW6slH (this book will be released
on jan 2014 or earlier)

If you donate $2000 to RVM I will grant full page advertisement, half page
for $1000 and quarter page ad for $500. If you have donated these amounts
you can contact me on mindaslab at gmail dot com so that I can put your ad
in it.

The advertisement will stay till Jan 31 2014. The ads must be designed by
you.

Please donate to RVM by going to
https://www.bountysource.com/fundraisers/489-rvm-2-0


-- 
Nothing is constant

Regards

A.K.Karthikeyan
http://is.gd/kblogs

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CADGU_bsnY-FQ8C5ywQ3%2BG2LefXy%2Bh0hm2Guh%3DU4JpfwB9G_WkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Free ad space if you donate to RVM

2013-11-07 Thread Emil S
Just curious. Did you get any comment about the cover being sexist ? It may
help to get more ads if you change the cover to something else , just my
opinion .
On 7 Nov 2013 20:55, Karthikeyan A.K mindas...@gmail.com wrote:

 Hello People,

 I am very much fond of rvm http://rvm.io/ . All the apps I have deployed
 runs on it. RVM needs funding so that it can be developed further. I want
 to hasten the process of funding.

 I have written a ruby programming book named ‘I Love Ruby’ thats totally
 free, you can get it here http://goo.gl/FW6slH (this book will be
 released on jan 2014 or earlier)

 If you donate $2000 to RVM I will grant full page advertisement, half page
 for $1000 and quarter page ad for $500. If you have donated these amounts
 you can contact me on mindaslab at gmail dot com so that I can put your ad
 in it.

 The advertisement will stay till Jan 31 2014. The ads must be designed by
 you.

 Please donate to RVM by going to
 https://www.bountysource.com/fundraisers/489-rvm-2-0


 --
 Nothing is constant

 Regards

 A.K.Karthikeyan
 http://is.gd/kblogs

  --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CADGU_bsnY-FQ8C5ywQ3%2BG2LefXy%2Bh0hm2Guh%3DU4JpfwB9G_WkQ%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAJ%3Dox-Ba3-BNn8%3D-L6O5FsOBUttD%3DWbPMUcvchJD7i09Wo4U7w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Free ad space if you donate to RVM

2013-11-07 Thread Loganathan Sellapa
Rofl thread going to start again banglre ppl knw what  I meant.

Emil,
For your safety dont discus further regarding his book cover... we tried it
more than an yr nothin happened so far.

Regards,
Logan

Sent from mobile device
On 7 Nov 2013 22:21, Emil S emil.so...@gmail.com wrote:

 Just curious. Did you get any comment about the cover being sexist ? It
 may help to get more ads if you change the cover to something else , just
 my opinion .
 On 7 Nov 2013 20:55, Karthikeyan A.K mindas...@gmail.com wrote:

 Hello People,

 I am very much fond of rvm http://rvm.io/ . All the apps I have deployed
 runs on it. RVM needs funding so that it can be developed further. I want
 to hasten the process of funding.

 I have written a ruby programming book named ‘I Love Ruby’ thats totally
 free, you can get it here http://goo.gl/FW6slH (this book will be
 released on jan 2014 or earlier)

 If you donate $2000 to RVM I will grant full page advertisement, half
 page for $1000 and quarter page ad for $500. If you have donated these
 amounts you can contact me on mindaslab at gmail dot com so that I can put
 your ad in it.

 The advertisement will stay till Jan 31 2014. The ads must be designed by
 you.

 Please donate to RVM by going to
 https://www.bountysource.com/fundraisers/489-rvm-2-0


 --
 Nothing is constant

 Regards

 A.K.Karthikeyan
 http://is.gd/kblogs

  --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CADGU_bsnY-FQ8C5ywQ3%2BG2LefXy%2Bh0hm2Guh%3DU4JpfwB9G_WkQ%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.

  --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CAJ%3Dox-Ba3-BNn8%3D-L6O5FsOBUttD%3DWbPMUcvchJD7i09Wo4U7w%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAD_i5ME0w4OjGoipL4Vqyn%2Bj80b6T4%3DQP3c%3DSZVjn%2BR-jSmB5g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Ruby code on Chef as a ruby_block not working

2013-11-07 Thread Rodrigo de Campos

Hi Ruby hackers,

I have very limited knowledge of the Ruby programming language, however, 
I need to implement on Chef (check-solo) something similar to augeas 
(which works with Puppet, but here I need a solution for Chef).


I got the example code below but it's not working and I am now for a few 
days trying to figure out what is wrong.


Basically I need to be able to select specific strings in a text file 
and modify these values. I could use sed but perhaps I can do it in a 
more elegant way using the ruby_block from Chef.


Please let me know what can be possibly wrong with the code below. Why 
is my /etc/hosts not being updated with new values?


Always when I re-run chef-solo, I get the following error:

*NoMethodError**
**-**
**undefined method `chef' for Chef::Resource::RubyBlock*


Thanks for your help.

Follows my *default.rb* file:

Code:

ruby_block edit etc hosts do
  block do
rc = Chef::Util::FileEdit.new(/etc/hosts)
rc.search_file_replace_line(
  /^127\.0\.0\.1 localhost$/,
  127.0.0.1 #{new_fqdn} #{new_hostname} localhost
)
rc.write_file
  end
end

--
Rodrigo de Campos
Unix System Administrator

--
You received this message because you are subscribed to the Google Groups Ruby on 
Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/527BA3B9.4070906%40netzmarkt.de.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Ruby code on Chef as a ruby_block not working

2013-11-07 Thread Tamara Temple
You should really ask about this in a chef support area, as it is something 
very specific to chef.

As it is, you cannot define local functions in chef recipes, they have to be 
defined in libraries and called from such.

Stackoverflow is really your best bet for help on chef things, or the #chef 
channel on irc.freenode.net

On Nov 7, 2013, at 8:29 AM, Rodrigo de Campos r...@netzmarkt.de wrote:

 Hi Ruby hackers,
 
 I have very limited knowledge of the Ruby programming language, however, I 
 need to implement on Chef (check-solo) something similar to augeas (which 
 works with Puppet, but here I need a solution for Chef).
 
 I got the example code below but it's not working and I am now for a few days 
 trying to figure out what is wrong.
 
 Basically I need to be able to select specific strings in a text file and 
 modify these values. I could use sed but perhaps I can do it in a more 
 elegant way using the ruby_block from Chef.
 
 Please let me know what can be possibly wrong with the code below. Why is my 
 /etc/hosts not being updated with new values? 
 
 Always when I re-run chef-solo, I get the following error:
 
 NoMethodError
 -
 undefined method `chef' for Chef::Resource::RubyBlock
 
 
 Thanks for your help.
 
 Follows my default.rb file:
 
 Code:
 ruby_block edit etc hosts do
   block do
 rc = Chef::Util::FileEdit.new(/etc/hosts)
 rc.search_file_replace_line(
   /^127\.0\.0\.1 localhost$/,
   127.0.0.1 #{new_fqdn} #{new_hostname} localhost
 )
 rc.write_file
   end
 end
 
 -- 
 Rodrigo de Campos
 Unix System Administrator
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/rubyonrails-talk/527BA3B9.4070906%40netzmarkt.de.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/4A14216C-7030-4F4A-B356-3E0571D683B0%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: can anyone please suggest me from where I need to start learning ruby on rails..??

2013-11-07 Thread Jason Hsu, Rubyist
My suggestions:
1.  Learn object-oriented programming in Python.  Python is easier to 
install, learn, and read than Ruby, and it paved the way to learning Ruby.
2.  Learn Ruby before learning Rails.  (tryruby.org provides a good 
introduction.)  I know that the majority of other Rubyists will back me up 
on this.  Not knowing Ruby first makes Rails seem too much like mysterious, 
unexplainable black magic.  Having a passing familiarity with Ruby makes 
Rails look somewhat less alien.
3.  Go through the Rails for Zombies tutorial at 
http://railsforzombies.org/ .  It gives you a good introduction to what 
Ruby on Rails can do, and it doesn't require installing Ruby on Rails.
4.  Go through railstutorial.org .  At least get through the first 7 
chapters.
5.  Start a good project that makes use of Ruby on Rails.  For me, these 
projects were Bargain Stock Funds (http://www.bargainstockfunds.com) and 
Doppler Value Investing (http://www.dopplervalueinvesting.com).  I just 
don't get that engaged from merely going through tutorials.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/fa4d6d2a-c805-4d7c-84a4-e049180ff89c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] grouped_collection_select for has_many :through Association not Updating

2013-11-07 Thread Jim Miller
I have a scenario where I created a few has_many :through associations
which I am having trouble updating. I do appreciate any help! Thank you!



Here is my setup:

ruby 1.9.3p392
Rails 3.2.13

Here is the scenario:

I have 3 models that are related
There are many Industries, many Keywords, and many Conferences
Industries have many Keywords
Conferences have an Industry
Conferences choose Keywords based on its Industry

Keywords has a basic CRUD model. Creating an Industry then adding
Keywords works fine.

My relationship for Conferences, Industries, and Keywords is where I am
having issues. I am trying to update Conference information, change the
Industry that it is currently associated with, choose new Keywords based
on the new Industry all in the same form. When I remove the Keywords
element out of the mix, the update works. But when all three are there,
then I get the errors.

The view renders fine but when I submit a change, I get an error. The
error that I am seeing is:


**Couldn't find Industry with ID=3 for Conference with ID=1**


My relationship for Industries and Keywords are:
***
class IKeywordable  ActiveRecord::Base

attr_accessible :industry_id, :keyword_id

belongs_to :industry
belongs_to :keyword

end

class CKeywordable  ActiveRecord::Base
attr_accessible :conference_id, :keyword_id

belongs_to :conference
belongs_to :keyword
end



Here are the Models:

class Industry  ActiveRecord::Base
attr_accessible :name,
:conferences_attributes,
:i_keywordables_attributes,
:keywords,
:keywords_attributes,
:keyword_ids

validates :name, presence: true
validates :name, uniqueness: true

# Associations
has_many :conferences
accepts_nested_attributes_for :conferences

#Keywords
has_many :i_keywordables
has_many :keywords, through: :i_keywordables
accepts_nested_attributes_for :i_keywordables
accepts_nested_attributes_for :keywords

end


class Keyword  ActiveRecord::Base

attr_accessible
:name, :profile_id, :active, :rating,
:c_keywordables_attributes,
:i_keywordables_attributes,
:industries_atributes

# Associations

#Industries
has_many :i_keywordables
has_many :industries, through: :i_keywordables
accepts_nested_attributes_for :i_keywordables

#Conferences
has_many :c_keywordables
has_many :conferences, through: :c_keywordables
accepts_nested_attributes_for :c_keywordables

end

class Conference  ActiveRecord::Base
attr_accessible
:name, :address1, :address2, :city, :email,
:web, :profile_id, :state_id, :conference,
:description, :date_start, :date_end, :venue, :venue_web,
:organizer, :organizer_web, :c_keywordables_attributes,
:industry_attributes, :industry_id,
:industry, :keyword_ids

# Associations

belongs_to :state
belongs_to :industry
accepts_nested_attributes_for :industry

#Keywords
has_many :c_keywordables
has_many :keywords, through: :c_keywordables
accepts_nested_attributes_for :c_keywordables

serialize :keywords, Array

def to_s
state_id
end

end




Here is the Conference/edit.html.erb

h2edit %= @conference.name %/h2
%= form_for @conference do |c| %
%= c.label :name %
%= c.text_field :name %
%= c.label :address1 %
%= c.text_field :address1 %
%= c.label :address2 %
%= c.text_field :address2 %
%= c.label :city %
%= c.text_field :city %
%= c.label :state_id%
%= c.collection_select :state_id, State.order(:name), :id, :name %
%= c.label :email %
%= c.text_field :email %
%= c.label :web %
%= c.text_field :web %
hr width=80%
%= c.label :industry_id %
%= c.collection_select :industry_id, Industry.order(:name), :id, :name
%
br /
%= c.fields_for :industry, @industry do |ci| %
%= ci.label :keyword_id %
%= ci.grouped_collection_select :keywords, Industry.order(:name),
:keywords,
:name,
:id,
:name,
{:include_blank = true}, { :multiple = true }
%
% end %
br /
p%= c.submit %/p
% end %



Here is the Conference Controller:

def edit
@conference = Conference.find(params[:id])
end

def update
@conference = Conference.find(params[:id])
if @conference.update_attributes(params[:conference])
redirect_to action: all, notice: 'conference was successfully
updated.'
else
render action: edit
end
end



Here are the parameters passed:

{utf8=✓, _method=put,
authenticity_token=k9fcAXF/iOXt3oVuTcxeDCaWOfE2PrVlBvFbQG8Mo/I=,
conference={name=test conference, address1=address 1,
address2=address 2, city=City, state_id=38,
email=t...@example.com, web=www.example.com,
industry_id=1, industry_attributes={keywords=[, 6, 5],
id=3}}, commit=Update Conference, action=update,
controller=conferences, id=1}



Thanks again for any help!!

-- 
Posted via 

[Rails] 240.chr different on Linux than Windows?

2013-11-07 Thread RVic
I'm sending a string through a socket connection from a rails app to 
another application. The string is delimited with 240.chr. On windows it 
runs fine, on Linux, it seems to put in a different looking character in 
for 240.chr. Is this some sort of encoding issue? Is there something simple 
I am overlooking? Thanks, RVic.

delim = 240.chr
if userSelected.blank?
  userSelected = userSending
end

s=row.to_s+delim+userSending+delim+userSelected+delim+message+delim+notes  

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/9121d0f4-086a-4a58-95f7-88f5e5d3ff49%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] 240.chr different on Linux than Windows?

2013-11-07 Thread Tamara Temple

On Nov 7, 2013, at 7:54 PM, RVic rvinc...@hotmail.com wrote:

 I'm sending a string through a socket connection from a rails app to 
 another application. The string is delimited with 240.chr. On windows it runs 
 fine, on Linux, it seems to put in a different looking character in for 
 240.chr. Is this some sort of encoding issue? Is there something simple I am 
 overlooking? Thanks, RVic.
 
 delim = 240.chr
 if userSelected.blank?
   userSelected = userSending
 end
 s=row.to_s+delim+userSending+delim+userSelected+delim+message+delim+notes 

If you’re using 240.chr as a delimiter, what difference does it make what the 
Glyph looks like? The other side should just split on 240.chr.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/9722E365-1223-45B1-8D68-EFD878788444%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] 240.chr different on Linux than Windows?

2013-11-07 Thread R Vince
I would think so, but the other side is a java socket listener app, and it
isn't splitting on it in Linux, but is on Windows.


On Thu, Nov 7, 2013 at 9:16 PM, Tamara Temple tamouse.li...@gmail.comwrote:


 On Nov 7, 2013, at 7:54 PM, RVic rvinc...@hotmail.com wrote:

  I'm sending a string through a socket connection from a rails app to
 another application. The string is delimited with 240.chr. On windows it
 runs fine, on Linux, it seems to put in a different looking character in
 for 240.chr. Is this some sort of encoding issue? Is there something simple
 I am overlooking? Thanks, RVic.
 
  delim = 240.chr
  if userSelected.blank?
userSelected = userSending
  end
 
 s=row.to_s+delim+userSending+delim+userSelected+delim+message+delim+notes

 If you’re using 240.chr as a delimiter, what difference does it make what
 the Glyph looks like? The other side should just split on 240.chr.

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Ruby on Rails: Talk group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/rubyonrails-talk/S36a7FtBdnU/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/9722E365-1223-45B1-8D68-EFD878788444%40gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAAHNhKX_0UMiR8MKEw%3DnKjFvyxsyWhPcGoeian5%3DyHAPbr_RvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] 240.chr different on Linux than Windows?

2013-11-07 Thread Tamara Temple

On Nov 7, 2013, at 8:20 PM, R Vince rvinc...@gmail.com wrote:

 I would think so, but the other side is a java socket listener app, and it 
 isn't splitting on it in Linux, but is on Windows.
 
 
 On Thu, Nov 7, 2013 at 9:16 PM, Tamara Temple tamouse.li...@gmail.com wrote:
 
 On Nov 7, 2013, at 7:54 PM, RVic rvinc...@hotmail.com wrote:
 
  I'm sending a string through a socket connection from a rails app to 
  another application. The string is delimited with 240.chr. On windows it 
  runs fine, on Linux, it seems to put in a different looking character in 
  for 240.chr. Is this some sort of encoding issue? Is there something simple 
  I am overlooking? Thanks, RVic.
 
  delim = 240.chr
  if userSelected.blank?
userSelected = userSending
  end
  
  s=row.to_s+delim+userSending+delim+userSelected+delim+message+delim+notes
 
 If you’re using 240.chr as a delimiter, what difference does it make what the 
 Glyph looks like? The other side should just split on 240.chr.

You need to be looking at the binary data stream to see what is being 
sent/received. Don’t look at the glyphs at all.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/A40941C7-3097-43C0-9B7D-6071987C4B1F%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] 240.chr different on Linux than Windows?

2013-11-07 Thread R Vince
On Thu, Nov 7, 2013 at 9:32 PM, Tamara Temple tamouse.li...@gmail.comwrote:



 You need to be looking at the binary data stream to see what is being
 sent/received. Don’t look at the glyphs at all.

 -

Yes, you;re right -- I need to open up the receiving end and see what it's
drinking in. Thanks!

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAAHNhKUBBjuBHr32jv8Te1j%3D%3DsJc2Hzc_Dy2bCGQjNFNmKYvLw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] How do I use Chef to manage database parameters?

2013-11-07 Thread Jason Hsu, Rubyist
As you know, the correct database name, username, and password in 
config/database.yml are needed for a Rails site to work.  I understand that 
the elegant way to provide these parameters is to use the Chef tool.  
However, I can't figure out how to do this.  I'll explain the solution I'm 
using instead:
1.  I have an Rails site called Bargain Stock Funds 
(http://www.bargainstockfunds.com).  The source code is at 
https://github.com/jhsu802701/bsf .  
2.  The config directory of my site's source code has a 
database.yml.template file instead of a database.yml file.  The database 
name is stored in the settings/db_name.txt file.  The config/update.rb file 
copies the config/database.yml.template file to config/database.yml and 
then uses my bsf_scrape Ruby gem to provide the database name, username, 
and password.
3.  The source code of my bsf_scrape gem is at 
https://github.com/jhsu802701/bsf_scrape .  This uses my database_params 
Ruby gem (https://github.com/jhsu802701/database_params) to record the 
database name and read the database name, username, and password.  In the 
development environment, the database username is the same as the UNIX 
system username, and there is no password.  In the production environment, 
the database username and password are stored in files outside the source 
code.

I realize that many of you probably consider my database management 
solution to be crude.  (Believe it or not, it was even cruder without the 
use of my database_params and string_in_file Ruby gems.)  However, the 
documentation for Chef is so complicated, the the examples I've read sound 
like they're for much more complicated setups than what I have.

Can someone shed some light on how I can transition my app to use Chef?  I 
can't do away with something crude that works until I have a viable 
replacement.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/496c2621-05b7-46e9-93a1-548e7528c949%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Export CSV

2013-11-07 Thread Daynthan Kabilan
Hi friends,

i am using csv export on my application. in my view file code is


%- headers = [Transaction ID, Activity ID, Product Name,Customer
Name, Ticket code] -%
%= CSV.generate_line(headers).strip %
%if !@trans.nil?  @trans.length  0 %
  % @trans.each do |tran|%

% if !tran.transaction_id.nil?  tran.transaction_id.present?%%tran_id
= tran.transaction_id%%else%%tran_id = -%%end%
% if !tran.activity_id.nil?  tran.activity_id.present?%%tran_actid =
tran.activity_id%%else%%tran_actid = -%%end%
% if !tran.activity_name.nil? 
tran.activity_name.present?%%tran_actname =
tran.activity_name%%else%%tran_actname = -%%end%
% if !tran.customer_name.nil?  tran.customer_name.present?%%cus_name =
tran.customer_name%%else%%cus_name = -%%end%
% if !tran.ticket_code.nil?  tran.ticket_code.present?%%tran_code =
tran.ticket_code%%else%%tran_code = -%%end%

%- row = [ tran_id, tran_actid,  tran_actname, cus_name, tran_code ]
-%
 %#= CSV.generate_line(row).html_safe.strip%
  %end%
%else%
  Sorry we found no results
%end%

now i got 5 extra empty rows how can avoid the empty rows.

thanks for advance.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJyRp%2B2XWWevjSM76ow5kjmDSsfzeKya_rCbENa8zpENPOg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.