[Rails] Re: REE and ruby PATH problem

2010-06-06 Thread tispratik
Thanks Ivan, but it still dosent work :(

ubuntu > sudo bluepill status
sudo: bluepill: command not found

-Pratik

On Jun 7, 1:24 am, Ivan Nastyukhin  wrote:
> sudo ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby /usr/bin/ruby
> sudo ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/gem /usr/bin/gem
> sudo ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/rake /usr/bin/rake
>
> Ivan Nastyukhin
> dieinz...@me.com
>
> On Jun 7, 2010, at 10:19 AM, tispratik wrote:
>
>
>
> > I have ruby normal edition installed in /usr/bin
> > REE in /opt/ruby-enterprise-1.8.7-2010.01/bin
> > I have all my application gems installed in /opt/ruby-
> > enterprise-1.8.7-2010.01/bin
> > but still when i run any gem related command, say "sudo bluepill
> > status", it looks for the executable in normal ruby edition instead of
> > REE
>
> > Any ideas?
>
> > ubuntu  > echo $PATH
> > /opt/ruby-enterprise-1.8.7-2010.01/bin
> > /usr/local/sphinx/bin
> > /usr/local/sbin
> > /usr/local/bin
> > /usr/sbin
> > /usr/bin
> > /sbin
> > /bin
>
> > ubuntu > bluepill
> > You must run bluepill as root.
>
> > ubuntu > sudo bluepill status
> > sudo: bluepill: command not found
>
> > ubuntu > which bluepill
> > bluepill is /opt/ruby-enterprise-1.8.7-2010.01/bin/bluepill
>
> > ubuntu > whereis bluepill
> > bluepill: /opt/ruby-enterprise-1.8.7-2010.01/bin/bluepill
>
> > ubuntu > ruby -v
> > ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770,
> > Ruby Enterprise Edition 2010.01
>
> > ubuntu > rails -v
> > Rails 2.3.5
>
> > ubuntu > gem -v
> > 1.3.5
>
> > ubuntu > gem list
> > actionmailer (2.3.5)
> > actionpack (2.3.5)
> > activerecord (2.3.5)
> > activeresource (2.3.5)
> > activesupport (2.3.5)
> > blankslate (2.1.2.3)
> > bluepill (0.0.38)
> > daemons (1.0.10)
> > eventmachine (0.12.10)
> > fastthread (1.0.7)
> > mysql (2.8.1)
> > passenger (2.2.14)
> > rack (1.0.1)
> > rails (2.3.5)
> > rake (0.8.7)
> > state_machine (0.9.2)
> > thin (1.2.7)
>
> > ubuntu > /usr/bin/gem list
> > actionmailer (2.3.5)
> > actionpack (2.3.5)
> > activerecord (2.3.5)
> > activeresource (2.3.5)
> > activesupport (2.3.5)
> > rubygems-update (1.3.7)
> > rack (1.0.1)
> > rails (2.3.5)
> > rake (0.8.7)
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Ruby on Rails: Talk" group.> To post to this group, send email 
> > torubyonrails-t...@googlegroups.com.> To unsubscribe from this group, send 
> > email torubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: REE and ruby PATH problem

2010-06-06 Thread tispratik
more information:

ubuntu > gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.5
  - RUBY VERSION: 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux]
  - INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.01/lib/
ruby/gems/1.8
  - RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.01/bin
  - RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
  - GEM PATHS:
 - /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8
 - /home/pratik/.gem/ruby/1.8
  - GEM CONFIGURATION:
 - :update_sources => true
 - :verbose => true
 - :benchmark => false
 - :backtrace => false
 - :bulk_threshold => 1000
 - "gem" => "--no-ri --no-rdoc"
 - :sources => ["http://gems.rubyforge.org";, "http://
gems.github.com"]
  - REMOTE SOURCES:
 - http://gems.rubyforge.org
 - http://gems.github.com

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Model validation giving problem

2010-06-06 Thread Tushar Gandhi
Hi,
I have a member registration form which takes a "Name", "Login",
"Password", "Confirm Password" and  "Location". In the user model I have
added the validation
validate_uniqueness_of :login, validate_presence_of :password, :name,
:confirm_password.

When the member tries to register every thing working fine. I am using
same form for user to edit his information. When the user come to edit
his information we are not allowing the user to edit the password so
that we are hiding those fields.
But whenever user adds some invalid data suppose he hasn't added the
"name" then the error is shown "Name should not be blank" but with that
it also shows that "Password should not be blank". I have checked the
post data don't have the password and confirm password parameter. My
controller code is like this:-

"@member = User.find(params[:user_id])
 @member.update_attributes(params[:user]) "
 Can anyone have any idea how to solve this?

Thanks
Tushar
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] REE and ruby PATH problem

2010-06-06 Thread Ivan Nastyukhin
sudo ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby /usr/bin/ruby
sudo ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/gem /usr/bin/gem
sudo ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/rake /usr/bin/rake


Ivan Nastyukhin
dieinz...@me.com






On Jun 7, 2010, at 10:19 AM, tispratik wrote:

> I have ruby normal edition installed in /usr/bin
> REE in /opt/ruby-enterprise-1.8.7-2010.01/bin
> I have all my application gems installed in /opt/ruby-
> enterprise-1.8.7-2010.01/bin
> but still when i run any gem related command, say "sudo bluepill
> status", it looks for the executable in normal ruby edition instead of
> REE
> 
> Any ideas?
> 
> ubuntu  > echo $PATH
> /opt/ruby-enterprise-1.8.7-2010.01/bin
> /usr/local/sphinx/bin
> /usr/local/sbin
> /usr/local/bin
> /usr/sbin
> /usr/bin
> /sbin
> /bin
> 
> ubuntu > bluepill
> You must run bluepill as root.
> 
> ubuntu > sudo bluepill status
> sudo: bluepill: command not found
> 
> ubuntu > which bluepill
> bluepill is /opt/ruby-enterprise-1.8.7-2010.01/bin/bluepill
> 
> ubuntu > whereis bluepill
> bluepill: /opt/ruby-enterprise-1.8.7-2010.01/bin/bluepill
> 
> ubuntu > ruby -v
> ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770,
> Ruby Enterprise Edition 2010.01
> 
> ubuntu > rails -v
> Rails 2.3.5
> 
> ubuntu > gem -v
> 1.3.5
> 
> 
> ubuntu > gem list
> actionmailer (2.3.5)
> actionpack (2.3.5)
> activerecord (2.3.5)
> activeresource (2.3.5)
> activesupport (2.3.5)
> blankslate (2.1.2.3)
> bluepill (0.0.38)
> daemons (1.0.10)
> eventmachine (0.12.10)
> fastthread (1.0.7)
> mysql (2.8.1)
> passenger (2.2.14)
> rack (1.0.1)
> rails (2.3.5)
> rake (0.8.7)
> state_machine (0.9.2)
> thin (1.2.7)
> 
> ubuntu > /usr/bin/gem list
> actionmailer (2.3.5)
> actionpack (2.3.5)
> activerecord (2.3.5)
> activeresource (2.3.5)
> activesupport (2.3.5)
> rubygems-update (1.3.7)
> rack (1.0.1)
> rails (2.3.5)
> rake (0.8.7)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] REE and ruby PATH problem

2010-06-06 Thread tispratik
I have ruby normal edition installed in /usr/bin
REE in /opt/ruby-enterprise-1.8.7-2010.01/bin
I have all my application gems installed in /opt/ruby-
enterprise-1.8.7-2010.01/bin
but still when i run any gem related command, say "sudo bluepill
status", it looks for the executable in normal ruby edition instead of
REE

Any ideas?

ubuntu  > echo $PATH
/opt/ruby-enterprise-1.8.7-2010.01/bin
/usr/local/sphinx/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin

ubuntu > bluepill
You must run bluepill as root.

ubuntu > sudo bluepill status
sudo: bluepill: command not found

ubuntu > which bluepill
bluepill is /opt/ruby-enterprise-1.8.7-2010.01/bin/bluepill

ubuntu > whereis bluepill
bluepill: /opt/ruby-enterprise-1.8.7-2010.01/bin/bluepill

ubuntu > ruby -v
ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770,
Ruby Enterprise Edition 2010.01

ubuntu > rails -v
Rails 2.3.5

ubuntu > gem -v
1.3.5


ubuntu > gem list
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
blankslate (2.1.2.3)
bluepill (0.0.38)
daemons (1.0.10)
eventmachine (0.12.10)
fastthread (1.0.7)
mysql (2.8.1)
passenger (2.2.14)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
state_machine (0.9.2)
thin (1.2.7)

ubuntu > /usr/bin/gem list
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
rubygems-update (1.3.7)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: net/http set content-type for images

2010-06-06 Thread Kim
Really? Do you really think there isn't a reason why I am not just
using an image_tag? Really?

The image is protected and I have been given access to pull it from my
web server to use in my app.

Looking for help in answering my original post please. Thanks.




On Jun 6, 8:52 pm, Hassan Schroeder 
wrote:
> Sorry, I originally thought this was to the ruby list...
>
> On Sun, Jun 6, 2010 at 8:17 PM, Kim  wrote:
> > I am asking how to turn the JPEG IO stream into an image I can pass on
> > and display in a view.
> > def index
> > result = Net::HTTP.get_response(URI.parse('http://
> > link_to_image.jpg') )
> > index.html.erb
> > @image = pretty picture
>
> Uh, why not just use an image_tag with the URL of the image?? Why
> are you even using Net::HTTP ?
>
> --
> Hassan Schroeder  hassan.schroe...@gmail.com
> twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: running passenger + nginx

2010-06-06 Thread Ivan Nastyukhin
u can use it 
http://gist.github.com/428270 
for manage your nginx

Ivan Nastyukhin
dieinz...@me.com






On Jun 7, 2010, at 9:50 AM, Gordon Yeong wrote:

> i think i found something. 
> Just send a SIGHUP signal to the nginx process via kill. 
> Seems to work well.
>  Anyone got a better idea? :)
> 
> thanks 
> 
> 
> 
> On 6 June 2010 14:10, ct9a  wrote:
> hi guys,
> 
>   Assuming I made some changes to the source code.
>  My production environment runs on passenger and nginx.
> 
>  How do I restart passenger and nginx with minimal downtime?
> 
> 
>  Surely I can't do a "w" on the terminal because a server will not
> always be in zero load.
> 
>  Would love to hear some recommendations.
> 
> 
> PS- I have read on unicorn (http://github.com/blog/517-unicorn) but
> would love to hear what we can do for passenger.
> 
> thanks
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: running passenger + nginx

2010-06-06 Thread Gordon Yeong
i think i found something.
Just send a SIGHUP signal to the nginx process via kill.
Seems to work well.
 Anyone got a better idea? :)

thanks



On 6 June 2010 14:10, ct9a  wrote:

> hi guys,
>
>   Assuming I made some changes to the source code.
>  My production environment runs on passenger and nginx.
>
>  How do I restart passenger and nginx with minimal downtime?
>
>
>  Surely I can't do a "w" on the terminal because a server will not
> always be in zero load.
>
>  Would love to hear some recommendations.
>
>
> PS- I have read on unicorn (http://github.com/blog/517-unicorn) but
> would love to hear what we can do for passenger.
>
> thanks

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: rake gems:freeze GEM=pdf-writer not working on MAC

2010-06-06 Thread Tushar Gandhi
Hi,
If that is the probelm then the command should also not work on windows. 
But it is working on windows. What is the reason?
Thanks
Tushar

Matt Jones wrote:
> It looks like Gem::Commands::UnpackCommand#get_path changed it's
> signature (from 2 args to 1) fairly recently - and much more recently
> than gemsonrails was last updated (July 2008 according to Github).
> 
> You'll definitely want to switch to a different mechanism for
> vendoring gems.
> 
> --Matt Jones

-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] authenticity_token shows up in the url when page reloads

2010-06-06 Thread Stephen Kilbourn
I'm pretty new to Ruby On Rails (and somewhat self-taught), so bear with
me if I'm asking something stupid. So whenever I push my download button
(which just uses send_file, if that's any help) it reloads the page,
without downloading, and it puts the authenticity_token in the url. This
all the button is:
<% form_remote_tag :url => { :action => 'download'} do %>
  <%= submit_tag "Download" %>
<% end %>

Basically, it's just not working at all, and I would appreciate any sort
of help with the issue. Thanks in advance.
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How do you update HABTM relationships or create.

2010-06-06 Thread Marnen Laibow-Koser
bramu...@gmail.com wrote:
> I am very new to Rails and I am more or less only 6 months to 1 year
> kid in Rails...
> 
> I just wondering with your code.. I really dont see what is
> "semantic_form_for " and f.buttons?? Is it view helper that you have
> written or any plugin which overrides the default form_for construct??
> This would be very helpful to me in writing the more maintainable
> Rails code...

He said he was using Formtastic.  That's probably where those methods 
come from.  But don't take my word for it.  Google is your friend in 
this case.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How do you update HABTM relationships or create.

2010-06-06 Thread bramu...@gmail.com
I am very new to Rails and I am more or less only 6 months to 1 year
kid in Rails...

I just wondering with your code.. I really dont see what is
"semantic_form_for " and f.buttons?? Is it view helper that you have
written or any plugin which overrides the default form_for construct??
This would be very helpful to me in writing the more maintainable
Rails code...

On Jun 6, 2:58 am, Ali Akhtarzada  wrote:
> Ok I found the problem, I had an attr_accessor :role_ids in my User model
> which was throwing things off. Everything worked after I removed it.
>
> On Sun, Jun 6, 2010 at 9:44 AM, Ali Akhtarzada 
> wrote:
>
>
>
> > Hi, just like the following:
>
> > <% semantic_form_for @user do |f| %>
> >   <% f.inputs do %>
> >     <%= f.input :email %>
> >     <%= f.input :first_name %>
> >     <%= f.input :last_name %>
> >     <%= f.input :roles %>
> >   <% end %>
> >   <%= f.buttons %>
> > <% end %>
>
> > On Sun, Jun 6, 2010 at 5:31 AM, Sijo k g  wrote:
>
> >> Hi
>
> >> How do u create form here?
>
> >> Sijo
> >> --
> >> Posted viahttp://www.ruby-forum.com/.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Ruby on Rails: Talk" group.
> >> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> rubyonrails-talk+unsubscr...@googlegroups.com >>  e...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: net/http set content-type for images

2010-06-06 Thread Hassan Schroeder
Sorry, I originally thought this was to the ruby list...

On Sun, Jun 6, 2010 at 8:17 PM, Kim  wrote:
> I am asking how to turn the JPEG IO stream into an image I can pass on
> and display in a view.

> def index
> result = Net::HTTP.get_response(URI.parse('http://
> link_to_image.jpg') )

> index.html.erb
> @image = pretty picture

Uh, why not just use an image_tag with the URL of the image?? Why
are you even using Net::HTTP ?

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re:

2010-06-06 Thread Tom Mac
Hi
   You are right. But still the problem. Please help if possible

Tom
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: net/http set content-type for images

2010-06-06 Thread Kim
I am asking how to turn the JPEG IO stream into an image I can pass on
and display in a view.

So I have

def index
result = Net::HTTP.get_response(URI.parse('http://
link_to_image.jpg') )
...
@image = ??

end

index.html.erb
@image = pretty picture


On Jun 6, 6:37 pm, Hassan Schroeder 
wrote:
> On Sun, Jun 6, 2010 at 5:40 PM, Kim  wrote:
> > I need to pull an image from a URL (I have permission) that is a .jpg.
> >  result = Net::HTTP.get_response(URI.parse('http://
> > link_to_image.jpg') )
>
> > result.body => gives me encoded junk.
>
> No, it gives you what you asked for: a JPEG-format IO stream.
>
> Are you saving it, or passing it to some other process, or what?
>
> > so I can display the image.
>
> Or in other words, "display" it how?
>
> --
> Hassan Schroeder  hassan.schroe...@gmail.com
> twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] net/http set content-type for images

2010-06-06 Thread Hassan Schroeder
On Sun, Jun 6, 2010 at 5:40 PM, Kim  wrote:
> I need to pull an image from a URL (I have permission) that is a .jpg.

>  result = Net::HTTP.get_response(URI.parse('http://
> link_to_image.jpg') )
>
> result.body => gives me encoded junk.

No, it gives you what you asked for: a JPEG-format IO stream.

Are you saving it, or passing it to some other process, or what?

> so I can display the image.

Or in other words, "display" it how?

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] net/http set content-type for images

2010-06-06 Thread Kim
I need to pull an image from a URL (I have permission) that is a .jpg.
I know I need to set the content-type to 'image/jpeg', but not sure
where to do that at.

 result = Net::HTTP.get_response(URI.parse('http://
link_to_image.jpg') )

result.body => gives me encoded junk.

Looking for help on how to set the content-type so I can display the
image.

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] disable erubis xss escaping

2010-06-06 Thread Marcelo Barbudas
Hi.

Is there a way to disable erubis auto escaping? I understand the
implications, and in our project everything in sanitized during input.

On the other hand, we use a lot of:
<%= "#{translate something} value #{translate another thing}
#{link_to ..}" if something else %>

Because of string interpolation everything gets borked.

--
M.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Marnen Laibow-Koser
Fernando Perez wrote:
> rubybox wrote:
>> Using redmine now for several days and its lovely,
>> nothing more I could wish for
> 
> Redmine is as bloated as an app can get.

Obviously you haven't used JIRA, which is a great example of bloat. 
Redmine is pretty simple and lightweight.

Then again, it's no surprise that I disagree with you on this point.  I 
recently realized that I don't think i've ever agreed with a single post 
of yours in this forum.

(Not meant as an attack -- just an observation.)

> I always wished I had time to 
> code my own lightweight issue tracker...

No one is stopping you. :)


Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Marnen Laibow-Koser
Ginty wrote:
[...]
> Once you have a server though you may as well just stick your master
> repository there. I still don't see any real need for the extra
> baggage of Gitosis or whatever if you are dealing with a 1 or 2 man
> team.

Then, when you've got your server and aren't using Dropbox for your 
repo, what do you use to host it if not Gitosis?  It's not extra baggage 
-- it's the easiest way to host a git repo from your own server.

Are you perchance confusing Gitosis with Gitorious?


Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: query

2010-06-06 Thread Marnen Laibow-Koser
Ar Chron wrote:
> Srinivas Golyalla wrote:
>> �Teacher� is a table in a database. Based on that information,
>> explain what the following query is searching for in the table:
>> Teacher.find(:all, :condition => { :grade => 9..12})
> 
> this query returns an uneducated student named srinivas

Well said!

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Marnen Laibow-Koser
Jian Lin wrote:
> Marnen Laibow-Koser wrote:
> 
>> 
>> Or...hmm.  Check out CoffeeScript; it's a bit like Haml for JS.
> 
> if only there is a Ruby to JS converter.

Well, there's RJS and CoffeeScript.  But Ruby and JS work very 
differently.  My advice is to write each one directly rather than 
relying on converters.

 Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org


-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] XMLHttpRequest and render :js not working

2010-06-06 Thread Fernando Perez
Hi,

So I uploaded a file to my server using an XMLHttpRequest and I wanted
to notify the client of the url of the uploaded file.

So in my app on the server side, I use for testing purposes:

render :js => "alert('File URL: blabla');"

but even though the client receives the successful response (traced in
Firebug), the alert doesn't show up. What could prevent that?

Thanks in advance for your insights,
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Require

2010-06-06 Thread Felix Schäfer

Am 06.06.2010 um 19:44 schrieb Ar Chron:

> require "srinivas_to_do_his_own_homework"

*sigh* Couldn't someone just block him from the list?

BR,

Felix

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Flash not deleting with Redis/Memcache store

2010-06-06 Thread Luca Guidi
Hi,
I've fixed this issue in 0.3.8 by replacing the old implementation,
borrowed from rack.
Just config the gem:
# config/environment.rb
config.gem "redis-store"

then configure as session store:
# config/initializers/session_store.rb
ActionController::Base.session_store = :redis_session_store

Luca

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: query

2010-06-06 Thread Ar Chron
Srinivas Golyalla wrote:
> �Teacher� is a table in a database. Based on that information,
> explain what the following query is searching for in the table:
> Teacher.find(:all, :condition => { :grade => 9..12})

this query returns an uneducated student named srinivas
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Require

2010-06-06 Thread Ar Chron
Srinivas Golyalla wrote:
> In Ruby there is a command called �require�. Explain what this command
> means and write an example of how it is used to include a Ruby Gem in
> a file.

require "srinivas_to_do_his_own_homework"
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: '.new' command

2010-06-06 Thread Ar Chron
Srinivas, you're behaving like an idiot, and as long as you make these 
pathetic attempts to get others to do your homework, you'll continue to 
be an idiot. Try actually reading and learning for yourself.

I just got finished sh--canning someone who looked great on paper 
because a certain someone, *cough* recruiter *cough*, thought he "had to 
be very smart, he had excellent grades in all his CS classes, and all 
these certifications".

Turns out the guy doesn't know jack, but expected to be treated special 
because he has this degree, and this certification and that 
certification.  He can go use those certs to start a campfire for all 
the weight they carry with me.

-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Problems testing a method to clone associations

2010-06-06 Thread Ginty
I've got a method to 'deep clone' an object, basically to clone it
plus all of its associations.

Here is the code:

def deep_clone
  clone = self.clone
  %w[phone_numbers addresses websites emails].each do |assoc|
clone.send("#{assoc}=", self.send(assoc).collect { |obj|
obj.clone })
  end
  clone
end

This works perfectly in practice, the problem is that it is failing
during test, like so:

clone = orig.deep_clone
clone.save
clone.emails.size.should == orig.emails.size# This passes
orig.emails.each { |e| clone.email_ids.should_not include e.id }   #
This fails

The fail is because the exact same email objects are assigned to both
the orig and the clone.
Looking at it in debug I can see that orig.emails and clone.emails (or
any other association for that matter) are tied together, such that
changing one mirrors the exact same change in the other.
I can also see that the clone is indeed a different object instance
from orig, it has a different id, and therefore clone.emails= should
not affect orig.emails.

Is this a bug or is there some nuance of the test environment I am
missing?

I am using the latest Rails 3 here, so I suspect it could be a genuine
bug...

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Ginty


On Jun 6, 11:55 am, Colin Law  wrote:
> On 6 June 2010 17:26, Ginty  wrote:
>
>
>
> > On Jun 6, 5:21 am, rubybox  wrote:
> >> Gitosis seems to be "dead" no git commits for 1 year?
> >> Is it actually stable usable? Are there some themes like github.com to
> >> make it look a bit more decent?
> >> Thx for the great writeup on this topic very informative
> >> Dont want to use dropbox I want my code to stay private so I just host
> >> locally and have a multi backup strategy
>
> > Your code is private with the Dropbox suggestion, it's a private
> > account that's password protected. No difference vs. a private Github
> > account in terms of access rights, apart from the fact the Dropbox one
> > is free that is.
>
> > In general I would say the Dropbox approach is best if you are just
> > starting out developing some apps and don't yet have a remote server
> > setup. It's easy to set up, and lets you share a master repository to
> > push and pull from with all your computers.
>
> > Here is a good blog on the setup:
>
> >http://blog.rogeriopvl.com/archives/using-git-with-dropbox
>
> Will that work if two users 'push' the same files at the same time?
> With a true central git repository it would handle merging the
> changes, but will Dropbox know how to do this?  I do not know enough
> about how git works under the hood to know the answer.
>
> Colin

Me neither, but I would think there is opportunity for problems under
such a scenario.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Fernando Perez
rubybox wrote:
> Using redmine now for several days and its lovely,
> nothing more I could wish for

Redmine is as bloated as an app can get. I always wished I had time to 
code my own lightweight issue tracker...
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Colin Law
On 6 June 2010 17:26, Ginty  wrote:
> On Jun 6, 5:21 am, rubybox  wrote:
>> Gitosis seems to be "dead" no git commits for 1 year?
>> Is it actually stable usable? Are there some themes like github.com to
>> make it look a bit more decent?
>> Thx for the great writeup on this topic very informative
>> Dont want to use dropbox I want my code to stay private so I just host
>> locally and have a multi backup strategy
>
> Your code is private with the Dropbox suggestion, it's a private
> account that's password protected. No difference vs. a private Github
> account in terms of access rights, apart from the fact the Dropbox one
> is free that is.
>
> In general I would say the Dropbox approach is best if you are just
> starting out developing some apps and don't yet have a remote server
> setup. It's easy to set up, and lets you share a master repository to
> push and pull from with all your computers.
>
> Here is a good blog on the setup:
>
> http://blog.rogeriopvl.com/archives/using-git-with-dropbox

Will that work if two users 'push' the same files at the same time?
With a true central git repository it would handle merging the
changes, but will Dropbox know how to do this?  I do not know enough
about how git works under the hood to know the answer.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Ginty
On Jun 6, 5:21 am, rubybox  wrote:
> Gitosis seems to be "dead" no git commits for 1 year?
> Is it actually stable usable? Are there some themes like github.com to
> make it look a bit more decent?
> Thx for the great writeup on this topic very informative
> Dont want to use dropbox I want my code to stay private so I just host
> locally and have a multi backup strategy

Your code is private with the Dropbox suggestion, it's a private
account that's password protected. No difference vs. a private Github
account in terms of access rights, apart from the fact the Dropbox one
is free that is.

In general I would say the Dropbox approach is best if you are just
starting out developing some apps and don't yet have a remote server
setup. It's easy to set up, and lets you share a master repository to
push and pull from with all your computers.

Here is a good blog on the setup:

http://blog.rogeriopvl.com/archives/using-git-with-dropbox

Once you have a server though you may as well just stick your master
repository there. I still don't see any real need for the extra
baggage of Gitosis or whatever if you are dealing with a 1 or 2 man
team.

>
> On Jun 6, 7:33 am, Marnen Laibow-Koser  wrote:
>
> > Ginty wrote:
> > > On Jun 3, 9:58 pm, Marnen Laibow-Koser  wrote:
> > >> Real user accounts in your repository. Even with one person and
> > >> Capistrano, that's two users, and they should have separate Git repo
> > >> accounts.
>
> > >> Also, can you push to a Git repo on Dropbox? If not, then it's not a
> > >> good Git hosting solution -- and of course it doesn't speak the Git
> > >> protocol.
>
> > > Of course, you interface to dropbox via a regular dir on your local
> > > machine, push, pull, anything else you can do locally. In the
> > > background the Dropbox client takes the updates away into the cloud
> > > and mirrors them to all of your other machines.
>
> > In other words, you're not using the remote copy as a Git repo -- you're
> > not pushing directly to it from your local machine?  If that's the case,
> > it's a huge disadvantage of Dropbox.
>
> > Set up a Github account and try pushing to it.  You'll see the
> > difference.
>
> > > Using it for this or not Dropbox is a truly great web app, and the
> > > paid versions are actually cheaper than you would pay S3 directly for
> > > the same amount of storage, plus 0 transfer charges.
>
> > But that's just backup.  It sounds like it isn't appropriate for
> > repository hosting.
>
> > > Also thanks for the Redmine suggestion, been trying it out today,
> > > great stuff!
>
> > You're welcome.
>
> > Best,
> > --
> > Marnen Laibow-Koserhttp://www.marnen.org
> > mar...@marnen.org
> > --
> > Posted viahttp://www.ruby-forum.com/.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Ginty
On Jun 6, 12:33 am, Marnen Laibow-Koser  wrote:
> Ginty wrote:
> > On Jun 3, 9:58 pm, Marnen Laibow-Koser  wrote:
> >> Real user accounts in your repository. Even with one person and
> >> Capistrano, that's two users, and they should have separate Git repo
> >> accounts.
>
> >> Also, can you push to a Git repo on Dropbox? If not, then it's not a
> >> good Git hosting solution -- and of course it doesn't speak the Git
> >> protocol.
>
> > Of course, you interface to dropbox via a regular dir on your local
> > machine, push, pull, anything else you can do locally. In the
> > background the Dropbox client takes the updates away into the cloud
> > and mirrors them to all of your other machines.
>
> In other words, you're not using the remote copy as a Git repo -- you're
> not pushing directly to it from your local machine?  If that's the case,
> it's a huge disadvantage of Dropbox.
>
> Set up a Github account and try pushing to it.  You'll see the
> difference.
>

Naw it's exactly the same workflow. Work on your local copy, push to
Dropbox, pull from wherever else you have access to your Dropbox.

>
>
> > Using it for this or not Dropbox is a truly great web app, and the
> > paid versions are actually cheaper than you would pay S3 directly for
> > the same amount of storage, plus 0 transfer charges.
>
> But that's just backup.  It sounds like it isn't appropriate for
> repository hosting.

It is.
>
>
>
> > Also thanks for the Redmine suggestion, been trying it out today,
> > great stuff!
>
> You're welcome.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: REE & application frozen gems

2010-06-06 Thread tispratik
Oh ok! I get it now, actually was confused by this post
http://blog.perplexedlabs.com/2009/01/13/installing-ruby-enterprise-edition-with-phusion-passenger/
where it says that you need to reinstall all gems and had
will_paginate in the list. I dont think will_paginate requires any
native extensions.

1. Ruby is not compiled.
2. Need to re-install only those gems which have a native extension.

1 more thing, do i need to set the path variable to point to /opt/ruby-
enterprise-1.8.7-2010.01/bin/ruby instead of /usr/bin/ruby,
so that any operations i do on my application residing at /home/deploy/
rails_apps/my_app the REE is used?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: problem with database still sqlite3 and i want mysql

2010-06-06 Thread gezope
Dear Fidel, thanks for your helpful answer! :) The thing why I ask
further questions here, and not in private is: maybe later will have
the same problem, and then it will be searchable! ;)

Your advice is fine; the 1,2,3,4 steps are okay (I am also new in
Linux, so i suggest 4. 'cd rubygems' you mean go to the new directory,
here it was 'cd rubygems-1.3.7' , let me know if I misunderstand it
please:))

After it: 5. ruby setup.rb says:

ERROR: While executing gem ... (Errno::EACCES)
Permission denied: ~ /usr/local/lib/site_ruby/1.8/geuntlet_rubygems.rb

I tried chmod and sudo chmod 644 and then this location, but it says:
cannot access (here the filename).

After it I tried to give the path, but i think gem is not on my system
yet, so it is kinda useless, but I tried, maybe...
(from here: https://help.ubuntu.com/community/RubyOnRails )
I tried this: export PATH=/var/lib/gems/1.8/bin:$PATH
After it still neither chmod or setup.rb runs.

I tried it 2 more time, once only from Synaptic :D, and then the same
way what u suggested (of course first delete every gem for gem list,
than remove gem, then remove ruby, than restart the procedure).

I also tried irb, than setup.rb, it says undefined local variable,
from the directory where it should be.

Finally I stopped here, in the 5th point, please help me go on! (It is
important for me, to get involved this Ubuntu community - without
Rails it seems hopeless. :O)

Thanks again, you already helped a lot! :)
all the bests, bueno vista,
gezope


On jún. 5, 20:20, Fidel Viegas  wrote:
> I am also using Ubuntu 10.04 and it all works fine for me.
>
> Don't install gems from the repository. Here is what I did:
>
> 1) sudo apt-get install ruby
> 2) wgethttp://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
> 3) tar -xvzf rubygems-1.3.7.tgz
> 4) cd rubygems
> 5) ruby setup.rb
> 6) gem install rails
>
> and you should be set. Don't forget to install mysql and sqlite3-ruby.
> Don't forget to install the development libraries for mysql and
> sqlite3. This are from the repository using apt-get
>
> When I installed rails from the repositories I ran into the same
> problems you are running now. It couldn't find teh application. I
> don't remember how I sorted it, but I know it had something to do with
> it not being in the path. I now only install ruby from the
> repositories. I manually download rubygems and then install it
> manually.
>
> Let me know if you still run into problems.
>
> All the best,
>
> Fidel.
>
> On 6/5/10, gezope  wrote:> Thank you for all for your help, 
> you are really helpful!
>
> > I uninstalled all gems from gem list. Than I removed gem and than
> > removed ruby.
> > Then:
> > 1. sudo apt-get install ruby ; ruby -v -> 1.8.7
> > 2. sudo apt-get install rubygems ; gem -v -> 1.3.5.
> > 3 sudo gem install rails ; rails -v or rails --version -> now gives me
> > the proram raisl currently not installed. Immediately after install! I
> > haven't typed a clear yet!
>
> > If I try rails my_app : it works. With -d mysql: still sqlite 3 in
> > the .yaml file.
>
> > I reinstalled again. I also deleted everything from ubuntu software
> > center. Then the first 2 steps.
> > And then the 3. sudo gem install rails -include-dependencies.
> > Now this -get opt problem like in the beginning. But rails does not
> > work. :) Neither with sqlite3.
> > Hopeless. Mysql still running. I should buy a Mac... :)
>
> > Now I will remove, reinstall again, maybe one another way, include
> > dependencies or not, export path or not, I try all of the versions. If
> > anyone knows a way, which is coorectly works allways, than please put
> > it to some ubuntu forum also, because every page say different way.
> > Maybe only 5% of the developers have these problems - but very hard to
> > be in this 5%. :)
>
> > Thx a lot again!
> > gezope
>
> > On jún. 4, 02:30, Hassan Schroeder  wrote:
> >> On Wed, Jun 2, 2010 at 1:39 PM, Gerő Zoltán  wrote:
> >> > I use Ubunu 10.4. I installed Ruby, Gem, than Rails. I chekcked:
> >> > rails -v -> getopt: invalid option -- 'v' (I don't understand this one,
> >> > it
> >> > should be different?)
>
> >> Yes, it should work.
>
> >> > I reinstalled rails a few time, because first I forget
> >> > -include-dependencies, or sudo, but now it seems okay
>
> >> No, it doesn't; the fact that it fails on a standard command-line option
> >> means you can't expect anything correct out of it.
>
> >> I would get rid of that current Rails installation completely and start
> >> from scratch.
>
> >> Good luck.
> >> --
> >> Hassan Schroeder  hassan.schroe...@gmail.com
> >> twitter: @hassan
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-t...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.co

[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Jian Lin
Marnen Laibow-Koser wrote:

> 
> Or...hmm.  Check out CoffeeScript; it's a bit like Haml for JS.

if only there is a Ruby to JS converter.

-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Marnen Laibow-Koser
Jian Lin wrote:
[...]
> 
> A reason may be, a comment that says "TODO: we don't have enough time to 
> do more than this right now.  talk to Simon for when it will be done" -- 
> or any other similar comment -- may not be totally appropriate for the 
> public.

I see your point about TODO comments.  But the fundamental problem here 
is that your client-side JS has to be delivered to the client to get 
run.  If there are things in the JS that your client shouldn't see, then 
you need a minifier or an obfuscator.

Or...hmm.  Check out CoffeeScript; it's a bit like Haml for JS.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: '.new' command

2010-06-06 Thread Matt Jones


On Jun 5, 4:46 am, Srinivas Golyalla  wrote:
> Using the ‘.new’ command, add a teacher to the data table with a name
> of ‘Sam’.

Not even *trying* to pretend you're not just using the list to do your
homework, eh?

See also:
http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/e91114d9a98a9990

http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/afa3c097afc07341

http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/7765ce45db1d3579

http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/8b58d050249f6182

http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/e6139316db43b581

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Jian Lin
Marnen Laibow-Koser wrote:
> Jian Lin wrote:
>> Marnen Laibow-Koser wrote:
>> 
 JS Minifier when there are 5 lines of code?
>>> 
>>> If there are only 5 lines of code, why do you need private comments in 
>>> the first place?
>> 
>> Do you often see other people's way of doing things needing to abide to 
>> your rule book?  Such as: if there are only n lines of Javascript code, 
>> they shall never have private comments there.
> 
> You missed my point.  It wasn't "shall never".  My point was this: a 
> 5-line routine should normally not need comments.  If you need comments 
> on something that short, perhaps your code isn't as clearly written as 
> it should be...

A reason may be, a comment that says "TODO: we don't have enough time to 
do more than this right now.  talk to Simon for when it will be done" -- 
or any other similar comment -- may not be totally appropriate for the 
public.
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Marnen Laibow-Koser
Jian Lin wrote:
> Marnen Laibow-Koser wrote:
> 
>>> JS Minifier when there are 5 lines of code?
>> 
>> If there are only 5 lines of code, why do you need private comments in 
>> the first place?
> 
> Do you often see other people's way of doing things needing to abide to 
> your rule book?  Such as: if there are only n lines of Javascript code, 
> they shall never have private comments there.

You missed my point.  It wasn't "shall never".  My point was this: a 
5-line routine should normally not need comments.  If you need comments 
on something that short, perhaps your code isn't as clearly written as 
it should be...


Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Jian Lin
Marnen Laibow-Koser wrote:

>> JS Minifier when there are 5 lines of code?
> 
> If there are only 5 lines of code, why do you need private comments in 
> the first place?

Do you often see other people's way of doing things needing to abide to 
your rule book?  Such as: if there are only n lines of Javascript code, 
they shall never have private comments there.



-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Marnen Laibow-Koser
Jian Lin wrote:
> Marnen Laibow-Koser wrote:
> 
>>> 1) -# to add comment but not to show it to the public
>> 
>> Use a JS minifier.
>> 
>>> 2) using if else to output something based on some condition
>>> 3) using loop
>> 
>> Use JavaScript control structures for these, not Ruby control 
>> structures.
>> 
>>> 4) providing values to javascript code by json
>> 
>> Put the JSON in a (hidden) div, have the JavaScript read its content.
> 
> JS Minifier when there are 5 lines of code?

If there are only 5 lines of code, why do you need private comments in 
the first place?

> 
> Also, I think we can always do things another way...

Yes.

> but just that why 
> embedding values from Ruby to Javascript is bad, while hiding them first 
> in a div and read it back from the div is good?

Because it separates the Ruby and JavaScript more cleanly.  This makes 
the code more maintainable, and also improves performance by allowing 
the client to cache one JavaScript file instead of the server having to 
regenerate it for each call.

>   (suppose they are 
> simple keywords from our db which keywords like "shirt", "shorts", 
> "jacket" which will not cause any javascript injection by user input.)

Then they should still be handled in the way I suggested.  Dynamically 
generating JavaScript is almost always a bad thing.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Handling an html5 drag n' drop upload

2010-06-06 Thread Fernando Perez
Hi,

I've started implementing an html5 drag n' drop upload feature. It's to
the point where the file is being uploaded and on the server-side I can
fetch the filename with request.env['HTTP_X_FILE_NAME'], but how to save
the file content?

In which parameter is it located? I tried request.body, but it doesn't
reproduce the initial file. I tried Base64 decoding also, but not luck?

Has anyone done work on that?

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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread Peter De Berdt


On 06 Jun 2010, at 12:21, rubybox wrote:


Gitosis seems to be "dead" no git commits for 1 year?
Is it actually stable usable? Are there some themes like github.com to
make it look a bit more decent?
Thx for the great writeup on this topic very informative
Dont want to use dropbox I want my code to stay private so I just host
locally and have a multi backup strategy


We've been using gitosis for years now and it's working flawlessly.  
Just because there's no commits doesn't mean it isn't stable. Github  
does provide more features, especially with the browser part, but it  
all comes down to whether you need that or not.



Best regards

Peter De Berdt

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Installing MySQL gem on Mac OS X Leopard for Rails 2.3.5

2010-06-06 Thread Ram
Hi,

Ive got Mac OS 10.5.8 and MySQL 5.0.67-osx10.5-x86 (installed in /usr/
local/mysql) working fine with my Rails 2.1.0 applications.

Im trying a test run of Rails 2.3.5 and having to install the MySQL
gem is literally driving me crazy! Ive tried all the following
commands, with sudo and without and I'm getting the same error for all
of them, ie.

ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.


The commands I've tried after much Googling and blog posts are,

env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/
usr/local/mysql/bin/mysql_config
env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/
local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-
include=/usr/local/mysql/include
env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/
local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-
include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/
bin/mysql_config
env ARCHFLAGS="-arch i386" gem install mysql --with-mysql-dir=/usr/
local/mysql
gem install mysql -- --with-mysql-dir=/usr/local/mysql
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/
mysql_config

As advised by the gem install o/p, I checked the mkmf.log file in /
Users//.gem/ruby/1.8/gems/mysql-2.8.1/ext/mysql_api/mkmf.log and
found this - "ld: library not found for -lmysqlclient" .

Hope someone can help me fix this. Quite frustrating!

Danke!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: ajax and redirect

2010-06-06 Thread javinto

Hi,

What you cannot do is mixing Ajax requests with full URL page requests

But what you can do is something like:

format.js {
  render :action=> search_show, :layout=>false
}

Your search_show view will be rendered without any application layout
provided you're using the same content @variables..

Jan


On Jun 6, 2:25 am, badnaam  wrote:
> Here is my use case
>
> I have a search model with two actions search_set and search_show.
>
> 1 - A user loads the home page which contains a search_form, rendered
> via a partial (search_form).
>
> 2 - User does a search, and the request goes to search_set, the search
> is saved and a redirect happens to search_show page which again
> renders the search_form with the saved search preferences. This search
> form is different than the one if step1, because it's a remote form
> being submitted to the same action (search set)
>
> 3 - Now the user does another search, and the search form is submitted
> via ajax to the search_set action. The search is saved and executed
> and now I need to present the result via rjs templates (corresponding
> to search_show). I am told that if the request is xhr then I can't
> redirect to the search_show action? Is that right? If yes, how do I
> handle this?
>
> Thanks

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Advise wanted on Ror software development and project m

2010-06-06 Thread rubybox
Gitosis seems to be "dead" no git commits for 1 year?
Is it actually stable usable? Are there some themes like github.com to
make it look a bit more decent?
Thx for the great writeup on this topic very informative
Dont want to use dropbox I want my code to stay private so I just host
locally and have a multi backup strategy

On Jun 6, 7:33 am, Marnen Laibow-Koser  wrote:
> Ginty wrote:
> > On Jun 3, 9:58 pm, Marnen Laibow-Koser  wrote:
> >> Real user accounts in your repository. Even with one person and
> >> Capistrano, that's two users, and they should have separate Git repo
> >> accounts.
>
> >> Also, can you push to a Git repo on Dropbox? If not, then it's not a
> >> good Git hosting solution -- and of course it doesn't speak the Git
> >> protocol.
>
> > Of course, you interface to dropbox via a regular dir on your local
> > machine, push, pull, anything else you can do locally. In the
> > background the Dropbox client takes the updates away into the cloud
> > and mirrors them to all of your other machines.
>
> In other words, you're not using the remote copy as a Git repo -- you're
> not pushing directly to it from your local machine?  If that's the case,
> it's a huge disadvantage of Dropbox.
>
> Set up a Github account and try pushing to it.  You'll see the
> difference.
>
>
>
> > Using it for this or not Dropbox is a truly great web app, and the
> > paid versions are actually cheaper than you would pay S3 directly for
> > the same amount of storage, plus 0 transfer charges.
>
> But that's just backup.  It sounds like it isn't appropriate for
> repository hosting.
>
>
>
> > Also thanks for the Redmine suggestion, been trying it out today,
> > great stuff!
>
> You're welcome.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Accessing form element on load

2010-06-06 Thread Vijay
This is the form and link i have in html.
<%= link_to_function "sample", "update_timer()" %>




onload of the page, i was showing the timer the update_timer()
function.


var page_loaded_ms = new Date().getTime();
var timeout_ms = 20*1000;

function update_timer() {
var time_left = Math.round((timeout_ms - new Date().getTime()
+ page_loaded_ms) / 1000);
var minutes = Math.floor(time_left/60);
var seconds = time_left - (minutes*60);
$('time_left').value = 'Time left: '+ minutes + ' min ' +
zeroPad(seconds, 2) + ' sec';

   if (minutes >= 0 && seconds > 0)
setTimeout("update_timer()", 100);
   else
 {
 clearTimeout();
 alert("timeOut");
 exit();
 }
}

function zeroPad(number, width) {
var s = number.toString();
while (s.length < width)
s = "0" + s;
return s;
}




while the page gets loaded the script was called , but the value was
not written to the text field.
But when clicking i was able to see the time in the text_field.
Could anyone suggest me a solution for this.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] launch error

2010-06-06 Thread Mike Peltzer
Hey all, I am just getting started with RoR and am having trouble
launching the localhost:3000 page. Here is the error message I am
getting in my command prompt:

C:\Users\Michael\rubydev\ch04\first>ruby script/server
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:827:in
`report_activate_error': R
ubyGem version error: rack(1.0.0 not ~> 1.0.1) (Gem::LoadError)
from C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:261:in
`activate'
from C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:68:in `gem'
from
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_cont
roller.rb:34:in `'
from
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_s
upport/dependencies.rb:156:in `require'
from
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_s
upport/dependencies.rb:156:in `block in require'
from
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_s
upport/dependencies.rb:521:in `new_constants_in'
from
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_s
upport/dependencies.rb:156:in `require'
from
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/commands/server.
rb:2:in `'
from script/server:3:in `require'
from script/server:3:in `' 

I am not sure how to fix this, any advice would be great! thank you in
advance!
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How to make an SQL querey Within a partial, is that possilbe??

2010-06-06 Thread Frederick Cheung


On Jun 6, 8:54 am, happysmiley  wrote:
>
> In the back I have to database tabels, the one "profiles" and a second
> "comments".
> In the second one I ve the column "profil_id" because my Idea was to
> search for the Id of the profil which is shown and than to display the
> comments in which the profil_id is the same.

You should have an association between profiles and comments (profile
has_one :comment or has_many :comments) and then profile.comment or
profile.comments will be the comment(s) you are looking for

Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Now Hiring: Lead Developer/RoR in NYC

2010-06-06 Thread PawLinks
We have an opening in NYC for a Lead Developer/RoR. See our listing
here: http://pawlinks.com/home/jobs

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: query

2010-06-06 Thread Sanjay Sarachandrakumaran
It would be a better practice to include all column names in the Select
instead of *


On Sat, Jun 5, 2010 at 3:29 PM, Srinivas Golyalla wrote:

> Thank You Sijo
>
> On Jun 5, 1:27 pm, Sijo k g  wrote:
> > > Teacher.find(:all, :condition => { :grade => 9..12})
> >
> > This means getting all records from teacher table teachers where
> > column grade has value between 9 & 12.
> >
> >select * from teachers where grade between 9 and 12
> >
> > Sijo
> >
> > --
> > Posted viahttp://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
Sanjay Sarachandrakumaran

Follow me
http://www.twitter.com/ssarachandra
http://www.facebook.com/ssarachandra

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: failure in model#new - I don't get it

2010-06-06 Thread Frederick Cheung


On Jun 6, 4:37 am, chewmanfoo  wrote:
>
>   after_save {
>     logger.info "attempting geocode retrieval for
> #{gmap_full_address}"        <--
>     result = get_geocode(gmap_full_address)
>     gmap_lat = result[:latitude]
>     gmap_long = result[:longitude]
>     save
>   }
>
>   def gmap_full_address
>     address1 + ", " + city + ", " + state.abbrev
>   end
>
> I don't understand why it's saying gmap_full_address is indefined.
>
> Anyone know why?

Because you've used the block form of after_save, so self inside that
block is the class itself, not a particular instance

Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: REE & application frozen gems

2010-06-06 Thread Frederick Cheung


On Jun 6, 6:37 am, Marnen Laibow-Koser  wrote:
> Pratik Khadloya wrote:
>
>
> > Shouldn't i install the gems using REE and then freeze them in prod
> > env?
>
> No.  There's no need.  Ruby is not compiled, so REE and MRI can run from
> the same source files.
>
The only exception being if the gem had a native extension, in which
case there's a rake task to rebuild it ( rake gems:build off the top
of my head)

Fred
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How to make an SQL querey Within a partial, is that possilbe??

2010-06-06 Thread happysmiley
 I JUST MISS THE END , sorry
Hello,
I'm quite new to Rails and english is even not my first language, so
please excused nescience and clerical mistake.
I'll try to explain my problem as good as possible.

I try to implement a page where a profil is shown, this is searched by
ID.
within this profil page I want to include the comments that refer to
this profil.
In the back I have to database tabels, the one "profiles" and a second
"comments".
In the second one I ve the column "profil_id" because my Idea was to
search for the Id of the profil which is shown and than to display the
comments in which the profil_id is the same.

I already tried to implement this Idea but I hit some problems:

the profil page works fine.

show.erb.html:
                
                        Titel
                        
                                
                                        <%= h @profil.title %>
                                
                        
                
                
                        
                        
                                
                                        <%= h @profil.subtitle %>
                                
                        
                
                

             ..
             ..
             

            
                Kommentare
                <%= render :partial => "comments/
comments_show", :locals=>{:profil_id=>@profil.id} %>
        

and there I tried to call a partial which display the comments...
And that my problem...
I hand over the profil_id (which works fine) but I ve NO idea how and
where to include the Search to find the comments with the same id...

in the file  _comments_show.erb.html i ll tried something like that:
   <%= h @comment.title %>
but that doesnt work.

Please help


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] How to make an SQL querey Within a partial, is that possilbe??

2010-06-06 Thread happysmiley
Hello,
I'm quite new to Rails and english is even not my first language, so
please excused nescience and clerical mistake.
I'll try to explain my problem as good as possible.

I try to implement a page where a profil is shown, this is searched by
ID.
within this profil page I want to include the comments that refer to
this profil.
In the back I have to database tabels, the one "profiles" and a second
"comments".
In the second one I ve the column "profil_id" because my Idea was to
search for the Id of the profil which is shown and than to display the
comments in which the profil_id is the same.

I already tried to implement this Idea but I hit some problems:

the profil page works fine.

show.erb.html:

Titel


<%= h @profil.title %>







<%= h @profil.subtitle %>





 ..
 ..
 


Kommentare
<%= render :partial => "comments/
comments_show", :locals=>{:profil_id=>@profil.id} %>



and there I tried to call a partial which display the comments...
And that my problem...
I hand over the profil_id (which works fine) but I ve NO idea how and
where to include the Search to find the comments with the same id...

in the file  _comments_show.erb.html i ll tried something like that:

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: hostingrails.com appears to have had an ownership change

2010-06-06 Thread Mickael Faivre-Macon
Hi,

Same here.
I have 5 small websites hosted at hostingrails.com.
Since April, I have much troubles with my apps.

I already wrote to the sales.

===
Your new support system, just for opening a technical support ticket is 
really annoying. With the old you could open a ticket in 2 clicks. Now I 
have to navigate through too many menus. It's really annoying.

Reply from Hostingrails.com (Sat May-01-2010 12:29):
I am sorry for any inconvenience this causes. With this new ticketing 
system we will keep track of your tickets in your Customer Manager so 
you can review them at any time. It is also better for tracking and to 
ensure you get a more timely response from the technicians.

I do understand it is more steps but it will be a benefit to you in 
regards to the support you receive and for referencing previous tickets.

If you have any other questions or concerns please let us know.



===
I don't want to bother you. I'm just a customer since 2006 that is 
beginning to think that your new support is really decreasing in 
quality.
I was talking about your new interface, now I am talking about the 
people behind it.
Before we had replies in less than 3 hours, with pertinent remarks and 
replies.
Now I have open a ticket about emails, they are avoiding questions, not 
analysing the server, and now that emails are working again, they don't 
know why (I didn't changed anything) and they still asking if the emails 
are not sent in my spam folder.
A migration have been done: all my apps hae been changed to a new 
servers, and nothing was ensured to get no regressions: I am still 
missing a rails 2.3.2 gem for one of my application.

I was really surprised to find a good level of service with HostingRails 
back then, now I am really thinking about leaving you guys. I prefer to 
pay more and have a greater service elsewhere.

Do something please, for the sake of your service image.

Best regards,
Mickael Faivre-Maçon.

Reply from Jumpline CS Agent Geoff S (Fri May-07-2010 09:35):

We are currently looking into this issue in your other support ticket.

===

Too sad.
Mickael Faivre-Maçon.
-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

2010-06-06 Thread Jian Lin
Marnen Laibow-Koser wrote:

>> 1) -# to add comment but not to show it to the public
> 
> Use a JS minifier.
> 
>> 2) using if else to output something based on some condition
>> 3) using loop
> 
> Use JavaScript control structures for these, not Ruby control 
> structures.
> 
>> 4) providing values to javascript code by json
> 
> Put the JSON in a (hidden) div, have the JavaScript read its content.

JS Minifier when there are 5 lines of code?

Also, I think we can always do things another way... but just that why 
embedding values from Ruby to Javascript is bad, while hiding them first 
in a div and read it back from the div is good?   (suppose they are 
simple keywords from our db which keywords like "shirt", "shorts", 
"jacket" which will not cause any javascript injection by user input.)


-- 
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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.