[Rails] Re: simple query

2011-10-07 Thread Misha Ognev
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-talk@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] custom copyright text to ruby file automatically

2011-10-07 Thread Leonardo Mateo
On Fri, Oct 7, 2011 at 3:10 PM, Nike Mike  wrote:
> How to automate the copyright text for each newly created files in ruby
> projects or with rails framework.

For Rails you can create your own generators[1].
For other Ruby projects, I guess it depends on how you create your
files. If you're using some sort of IDE, it will depend on that,
otherwise, you;ll have to add it yourself.

Hope it helps.

[1]http://guides.rubyonrails.org/generators.html


-- 
Leonardo Mateo.
There's no place like ~

-- 
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-talk@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] simple query

2011-10-07 Thread Nick Demeschenko
select * from table_name sort by some_column asc/desc limit 10

2011/10/7 Misha Ognev 

> What is SQL query, which retrieves last 10 records from database?
>
> I can't find it in guides.rubyonrails.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-talk@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.
>
>


-- 

Sincerely,
Nikita Demeschenko

-- 
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-talk@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 host Ruby Rails application in https .

2011-10-07 Thread Sasi
Thanks pal. Using a single apache with multiple virtual host im able
to achieve https and run my run application .



ServerName somename.com

Options FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]





RailsEnv development
   
  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
#  Deny from none
  Allow from all
   
ProxyPreserveHost on

Document /home/sasi/SampleApp/public

ServerName somename.com
ErrorLog "/usr/local/apache2/logs/error_log"
TransferLog "/usr/local/apache2/logs/access_log"
SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:
+SSLv2:+EXP:+eNULL


SSLCertificateFile "/home/sasi/Demo_ssl_root_certificates/
ssl_demo211.cer"


SSLOptions +StdEnvVars


SSLOptions +StdEnvVars


BrowserMatch ".*MSIE.*" \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0

CustomLog "/usr/local/apache2/logs/ssl_request_log" \
  "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"


Through single server setup im able to achieve this (placing app and
db in the server ) works fine.  Can u suggest me . How can i achieve
this in a three tier architecture . (Web component simple apache , App
server containing passenger module with apache pointing the
application , db server in a seperate machine ) . Between web,db and
app im able to esatblish connection. But with respect to https . When
i call from webserver to app internally the URL shifts back to http
from https so url breaks up in this case. Any ruby plugin / gum which
will support https (SSL) to stay .


On Oct 7, 10:31 pm, Leonardo Mateo  wrote:
> On Fri, Oct 7, 2011 at 2:04 PM, Sasi  wrote:
> > How to make my ruby on rails application to work on with https
> > protocol .  My application rails version - 2.3.8 . I use phusion
> > passenger and apache as server . Kindly help me how to make it up .
>
> That's not Rails specific. You need to setup your Apache server to use SSL.
> I'm not an Apache expert, but I think you have to:
> - Enable mod_ssl
> - Setup the port SSL will listen to (The default might be commented on
> your conf file)
> - Define your virtualhost for that port.
>
> If your server already has SSL configured, you only need to define your vhost.
>
> Hope it helps.
>
>
>
> > --
> > 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-talk@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> Leonardo Mateo.
> There's no place like ~

-- 
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-talk@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 host Ruby Rails application in https .

2011-10-07 Thread Sasi
Thanks pal .. Using multiple virtual hosts in a single apache im to
configure the apache in https make my application to run in https.



ServerName somename.com

Options FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]





RailsEnv development
   
  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
#  Deny from none
  Allow from all
   
ProxyPreserveHost on

Document /home/sasi/SampleApp/public

ServerName somename.com
ErrorLog "/usr/local/apache2/logs/error_log"
TransferLog "/usr/local/apache2/logs/access_log"
SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:
+SSLv2:+EXP:+eNULL


SSLCertificateFile "/home/sasi/Demo_ssl_root_certificates/
ssl_demo211.cer"


SSLOptions +StdEnvVars


SSLOptions +StdEnvVars


BrowserMatch ".*MSIE.*" \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0

CustomLog "/usr/local/apache2/logs/ssl_request_log" \
  "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"


Through single server setup im able to achieve this (placing app and
db in the server ) works fine.  Can u suggest me . How can i achieve
this in a three tier architecture . (Web component simple apache , App
server containing passenger module with apache pointing the
application , db server in a seperate machine ) . To db  and app im
able to esatblish connection. But with respect to https . When i call
from webserver to app internally the URL shifts back to http from
https.

On Oct 7, 10:31 pm, Leonardo Mateo  wrote:
> On Fri, Oct 7, 2011 at 2:04 PM, Sasi  wrote:
> > How to make my ruby on rails application to work on with https
> > protocol .  My application rails version - 2.3.8 . I use phusion
> > passenger and apache as server . Kindly help me how to make it up .
>
> That's not Rails specific. You need to setup your Apache server to use SSL.
> I'm not an Apache expert, but I think you have to:
> - Enable mod_ssl
> - Setup the port SSL will listen to (The default might be commented on
> your conf file)
> - Define your virtualhost for that port.
>
> If your server already has SSL configured, you only need to define your vhost.
>
> Hope it helps.
>
>
>
> > --
> > 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-talk@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> Leonardo Mateo.
> There's no place like ~

-- 
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-talk@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: Why does this work?

2011-10-07 Thread Frederick Cheung


On Oct 7, 7:45 pm, Jonathan Telfer  wrote:
> I've been working through the Depot application to get back into Rails
> after a few years doing other things. While I was looking at some
> functional tests earlier I started thinking about this:
>
> put :update, id: @user.to_param, user: @input_attributes
>
> why doesn't the "id: @..." part throw an exception? id: isn't a
> symbol. Is this some sort of alternative method of declaring a hash?

Correct - ruby 1.9 added a json-ish alternative syntax for hash
literals

Fred
> Is it a method call?
>
> It works, which is great, but I'd love to know why.

-- 
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-talk@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] Why does this work?

2011-10-07 Thread Jonathan Telfer
I've been working through the Depot application to get back into Rails
after a few years doing other things. While I was looking at some
functional tests earlier I started thinking about this:

put :update, id: @user.to_param, user: @input_attributes

why doesn't the "id: @..." part throw an exception? id: isn't a
symbol. Is this some sort of alternative method of declaring a hash?
Is it a method call?

It works, which is great, but I'd love to know why.

-- 
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-talk@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: DevKit version wrong?

2011-10-07 Thread Barney


On Oct 6, 4:46 pm, Roy Situmorang  wrote:
> I'm not sure if the following step can help but I suggest you to try.
>
> Open your command shell and navigate to the DevKit installation folder.
> Enter and run the following command:
> *  devkitvars*
>
> Then install the gem:
>   *gem install linecache19*

Thank you, I'll try those 2 lines on Monday when I can get access to
the machines.
Barney

-- 
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-talk@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: Heroku application error

2011-10-07 Thread Zach S.
I also ran into the same error after following the instructions when
following the instructions in Ruby on Rails Tutorial: Learn Rails by
Example http://ruby.railstutorial.org/chapters/beginning#top by
Michael Hartl.

The problem is that Heroku doesn't support the SQLite.

The solution is to convert your database to either MongoDB or
PostgreSQL.  The instructions can be found at
http://railsapps.github.com/rails-heroku-tutorial.html.

-- 
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-talk@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] Ruby adoption statistics

2011-10-07 Thread Kevin Bedell
Specifically to address Ruby being a dying language:


I find ohloh.net to be a great source of information on topics like this.

  http://www.ohloh.net/p/ruby

  Ruby:

 Source tree:
 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/

  - Is approaching 1 million lines of code and growing.
  - Has had 46 developers commit code over the last year: "This is one of
the largest open-source teams in the world, and is in the top 2% of all
project teams on Ohloh."
   - Is the main language for many other innovative new applications and
libraries including rails, rubygems, rake, rspec, cucumber, redmine,
capistrano, haml, and many others. (See
http://www.ohloh.net/p?sort=users&q=language%3Aruby )

Anyway, this is just a quick scrape of some stats. There's much more if you
dig around there and other places.

Kevin Bedell

--
Kevin Bedell
Principal, Boston Agile Partners
@kbedell

-- 
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-talk@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] Ruby adoption statistics

2011-10-07 Thread Bill Walton
Hi Andrew,

On Fri, Oct 7, 2011 at 1:34 PM, Andrew  wrote:
> Do you know where I can find articles/statistics on Ruby adoption

It's going to be difficult to get good data.  The biggest reason,
IMHO, is that companies that do adopt RoR are going to be doing so for
the productivity.  If it works, they're not going to talk about it.
That's what 'strategic advantages' are all about.  Keep your mouth
shut and hope your competitors don't figure it out.

If you're convinced that you need hard data then I'd recommend looking
for secondary indicators: growth of hosting providers is one.  How
many are there today vs. 2 years ago.  Do they say anything about
customer base?  What about financial condition?  There are tertiary
indicators as well.  Of those hosting providers, how many moved into
new digs this year?  They moving up?  Or scaling back?  I doubt very
seriously that the leg-work will pay off (see below for why) but it
would be an interesting exercise.  If you do undertake it, I'm sure
you'll be able to find a publisher who'll pay you a small amount (way
out of proportion if you do the per-hour calculation, so don't ;-) )
to publish it.

> and how I can convince my co-worker(s) that Ruby is the way to go?

You probably can't 'convince' them.  The choice isn't so much rational
as it is personal preference.  There are, IME, two ends to the
programmer-preference spectrum:  Java and Rails.

The spectrum is most easily characterized by the individual's
tolerance for delay in the gratification / feedback loop.  I liken the
Java end to the guys who build the huge, elaborate domino knock-down
displays.  Please understand that I am not criticizing at all; simply
making an observation on human nature.  The domino guys get a big dose
of gratification when the dominoes all fall.  But it's not about the
dominoes falling.  It's about the validation that all the setup steps
were done perfectly.  It's the validation that counts.  If the
dominoes all fell because the ground shook, there'd be no joy.

So if I were you (embarked on organizational change) I'd ignore the
developers who've already expressed a preference for Java.  Focus on
the ones that may be more attracted to a rapid-feedback model.
Introduce them gently; perhaps via your local ruby brigade.  Get them
around some folks who are clearly having more fun than them.  In any
event, they'll get some free pizza ;-)

Good luck and best regards,
Bill

-- 
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-talk@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] Errors while installing sqlite3 for Rails

2011-10-07 Thread Ruby Student
I downloaded rake-0.9.2 and I was able to create the DB: *rake db:create*.
Now, let me see what else I will find.

Thanks to everyone who tried to help.


On Fri, Oct 7, 2011 at 2:00 PM, Ruby Student  wrote:

> Leonardo,
>
> Yes, the executable are on my path. However, you suggested to type *node*,
> which was the only one I had not installed.
> I downloaded and built *node* and now I am past that issue.
>
> However, NOW I have other issues. This is like pulling teeth. If I did not
> want to learn Rails so badly, I would drop this altogether.
>
> This is what I am getting now:
>
>
> # rake db:create
> (in /opt/rails_3.1.0/Code/Ruby/blog)
> rake aborted!
> uninitialized constant Rake::DSL
> /usr/local/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
> /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/testtask.rb:4:in
> `require'
> /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/testtask.rb:4:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/testing.rake:2:in
> `require'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/testing.rake:2:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/railtie.rb:12:in
> `load'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/railtie.rb:12:in
> `block in '
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
> `call'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
> `block in load_tasks'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
> `each'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
> `load_tasks'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:395:in
> `block in load_tasks'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in
> `each'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in
> `all'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:395:in
> `load_tasks'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:99:in
> `load_tasks'
> /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in
> `method_missing'
> /opt/rails_3.1.0/Code/Ruby/blog/Rakefile:7:in `'
>
> /usr/local/lib/ruby/1.9.1/rake.rb:2373:in `load'
> /usr/local/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
> /usr/local/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
> /usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
> /usr/local/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
> /usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run'
> /usr/local/bin/rake:31:in `'
>
>
>
>  Fri, Oct 7, 2011 at 1:26 PM, Leonardo Mateo wrote:
>
>> On Fri, Oct 7, 2011 at 1:38 PM, Ruby Student 
>> wrote:
>> >
>> >
>> > On Thu, Oct 6, 2011 at 4:20 PM, Colin Law 
>> wrote:
>> >>
>> >> On 6 October 2011 21:09, Ruby Student  wrote:
>> >> > I'm sorry, I thought I said on my post that I tried the suggestion
>> from
>> >> > the
>> >> > failure messages.
>> >> > Anyway, this is what I got:
>> >> >
>> >> > port install sqlite3 +universal
>> >> > Command not found.
>> >> >
>> >> > yum install sqlite3-devel
>> >> > Setting up Install Process
>> >> > No package sqlite3-devel available.
>> >> > Error: Nothing to do
>> >> >
>> >> > As I said before, I am running Redhat 6.1 64bit.
>> >>
>> >> I don't know much about redhat but googling for
>> >> install sqlite-devel redhat
>> >> gave a number of hits including
>> >>
>> >>
>> http://www.sheepguardingllama.com/2008/11/installing-ruby-sqlite3-on-red-hat-or-centos-linux/
>> >> That or one of the others may be helpful
>> >>
>> > Colin, the link you gave me helped install sqlite3. That's fine.
>> > However, it looks like Rails is still looking for more dependencies,
>> which I
>> > already installed, except that I hit one which I can't see how to
>> address
>> > it.
>> > The execjs wants a javascript runtime. I installed at least three
>> suggested
>> > ones:
>> Are those on your path? I mean, the executable for those runtimes.
>> Can you just run
>> $ node
>> for example?
>>
>> >
>> > ExecJS supports these runtimes:
>> >
>> > therubyracer - Google V8 embedded within Ruby
>> > therubyrhino - Mozilla Rhino embedded within JRuby
>> > Johnson - Mozilla SpiderMonkey embedded within Ruby
>> > Mustang - Mustang V8 embedded within Ruby
>> > Node.js
>> >
>> >  and I am still having the same error messages, which I am posting
>> below.
>> >
>> > I am truly sorry to bother you but I hit a wall. Also, I am not sure why
>> > Rails does not load everything it needs. It already loads a large number
>> of
>> > pre-reqs.
>> >

[Rails] Ruby adoption statistics

2011-10-07 Thread Andrew
Hello,

I work for a company that uses PHP. In my free time I write Ruby apps. My 
manager recently "discovered" Heroku (which I had been using for a while) 
which spawned a discussion about eventually switching languages to start 
doing Ruby development (which would be awesome for me). However, my 
co-worker mentioned that he thinks if we are switching, we should switch to 
Java because Ruby is a dying language.

I just about fell out of my seat. *Dying* language? Far from it! Every 
company I know is deploying Ruby applications!

However, I don't have any stats to support this. I only have my experience 
and love of the language to base my opinions on. Do you know where I can 
find articles/statistics on Ruby adoption and how I can convince my 
co-worker(s) that Ruby is the way to go?

Thanks,
Andrew

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/qop4z-1g07EJ.
To post to this group, send email to rubyonrails-talk@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: Recommended SOAP library

2011-10-07 Thread Nick Klauer
Savon worked great for my use case, and I know of a couple other people that 
used it for integrating with other APIs pretty easily.  You probably won't 
go wrong picking this one.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/B3ZeRgw6qk4J.
To post to this group, send email to rubyonrails-talk@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] simple query

2011-10-07 Thread Misha Ognev
What is SQL query, which retrieves last 10 records from database?

I can't find it in guides.rubyonrails.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-talk@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] custom copyright text to ruby file automatically

2011-10-07 Thread Nike Mike
How to automate the copyright text for each newly created files in ruby
projects or with rails framework.

-- 
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-talk@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] Errors while installing sqlite3 for Rails

2011-10-07 Thread Ruby Student
Leonardo,

Yes, the executable are on my path. However, you suggested to type *node*,
which was the only one I had not installed.
I downloaded and built *node* and now I am past that issue.

However, NOW I have other issues. This is like pulling teeth. If I did not
want to learn Rails so badly, I would drop this altogether.

This is what I am getting now:

# rake db:create
(in /opt/rails_3.1.0/Code/Ruby/blog)
rake aborted!
uninitialized constant Rake::DSL
/usr/local/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/testtask.rb:4:in
`require'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/testtask.rb:4:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/testing.rake:2:in
`require'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/testing.rake:2:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/railtie.rb:12:in
`load'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/test_unit/railtie.rb:12:in
`block in '
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
`call'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
`block in load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
`each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie.rb:183:in
`load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:395:in
`block in load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in
`each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in
`all'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:395:in
`load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:99:in
`load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in
`method_missing'
/opt/rails_3.1.0/Code/Ruby/blog/Rakefile:7:in `'
/usr/local/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/local/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/local/bin/rake:31:in `'



 Fri, Oct 7, 2011 at 1:26 PM, Leonardo Mateo wrote:

> On Fri, Oct 7, 2011 at 1:38 PM, Ruby Student 
> wrote:
> >
> >
> > On Thu, Oct 6, 2011 at 4:20 PM, Colin Law 
> wrote:
> >>
> >> On 6 October 2011 21:09, Ruby Student  wrote:
> >> > I'm sorry, I thought I said on my post that I tried the suggestion
> from
> >> > the
> >> > failure messages.
> >> > Anyway, this is what I got:
> >> >
> >> > port install sqlite3 +universal
> >> > Command not found.
> >> >
> >> > yum install sqlite3-devel
> >> > Setting up Install Process
> >> > No package sqlite3-devel available.
> >> > Error: Nothing to do
> >> >
> >> > As I said before, I am running Redhat 6.1 64bit.
> >>
> >> I don't know much about redhat but googling for
> >> install sqlite-devel redhat
> >> gave a number of hits including
> >>
> >>
> http://www.sheepguardingllama.com/2008/11/installing-ruby-sqlite3-on-red-hat-or-centos-linux/
> >> That or one of the others may be helpful
> >>
> > Colin, the link you gave me helped install sqlite3. That's fine.
> > However, it looks like Rails is still looking for more dependencies,
> which I
> > already installed, except that I hit one which I can't see how to address
> > it.
> > The execjs wants a javascript runtime. I installed at least three
> suggested
> > ones:
> Are those on your path? I mean, the executable for those runtimes.
> Can you just run
> $ node
> for example?
>
> >
> > ExecJS supports these runtimes:
> >
> > therubyracer - Google V8 embedded within Ruby
> > therubyrhino - Mozilla Rhino embedded within JRuby
> > Johnson - Mozilla SpiderMonkey embedded within Ruby
> > Mustang - Mustang V8 embedded within Ruby
> > Node.js
> >
> >  and I am still having the same error messages, which I am posting below.
> >
> > I am truly sorry to bother you but I hit a wall. Also, I am not sure why
> > Rails does not load everything it needs. It already loads a large number
> of
> > pre-reqs.
> >
> > Thank you
> >
> > # rake db:create
> > (in /opt/rails_3.1.0/Code/Ruby/blog)
> > rake aborted!
> > Could not find a JavaScript runtime. See
> > https://github.com/sstephenson/execjs for a list of available runtimes.
> >
> /usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in
> > `autodetect'
> > /usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:5:in
> > `'
> > /u

Re: [Rails] How to host Ruby Rails application in https .

2011-10-07 Thread Leonardo Mateo
On Fri, Oct 7, 2011 at 2:04 PM, Sasi  wrote:
> How to make my ruby on rails application to work on with https
> protocol .  My application rails version - 2.3.8 . I use phusion
> passenger and apache as server . Kindly help me how to make it up .
That's not Rails specific. You need to setup your Apache server to use SSL.
I'm not an Apache expert, but I think you have to:
- Enable mod_ssl
- Setup the port SSL will listen to (The default might be commented on
your conf file)
- Define your virtualhost for that port.

If your server already has SSL configured, you only need to define your vhost.

Hope it helps.

>
> --
> 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-talk@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.
>
>



-- 
Leonardo Mateo.
There's no place like ~

-- 
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-talk@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] Errors while installing sqlite3 for Rails

2011-10-07 Thread Leonardo Mateo
On Fri, Oct 7, 2011 at 1:38 PM, Ruby Student  wrote:
>
>
> On Thu, Oct 6, 2011 at 4:20 PM, Colin Law  wrote:
>>
>> On 6 October 2011 21:09, Ruby Student  wrote:
>> > I'm sorry, I thought I said on my post that I tried the suggestion from
>> > the
>> > failure messages.
>> > Anyway, this is what I got:
>> >
>> > port install sqlite3 +universal
>> > Command not found.
>> >
>> > yum install sqlite3-devel
>> > Setting up Install Process
>> > No package sqlite3-devel available.
>> > Error: Nothing to do
>> >
>> > As I said before, I am running Redhat 6.1 64bit.
>>
>> I don't know much about redhat but googling for
>> install sqlite-devel redhat
>> gave a number of hits including
>>
>> http://www.sheepguardingllama.com/2008/11/installing-ruby-sqlite3-on-red-hat-or-centos-linux/
>> That or one of the others may be helpful
>>
> Colin, the link you gave me helped install sqlite3. That's fine.
> However, it looks like Rails is still looking for more dependencies, which I
> already installed, except that I hit one which I can't see how to address
> it.
> The execjs wants a javascript runtime. I installed at least three suggested
> ones:
Are those on your path? I mean, the executable for those runtimes.
Can you just run
$ node
for example?

>
> ExecJS supports these runtimes:
>
> therubyracer - Google V8 embedded within Ruby
> therubyrhino - Mozilla Rhino embedded within JRuby
> Johnson - Mozilla SpiderMonkey embedded within Ruby
> Mustang - Mustang V8 embedded within Ruby
> Node.js
>
>  and I am still having the same error messages, which I am posting below.
>
> I am truly sorry to bother you but I hit a wall. Also, I am not sure why
> Rails does not load everything it needs. It already loads a large number of
> pre-reqs.
>
> Thank you
>
> # rake db:create
> (in /opt/rails_3.1.0/Code/Ruby/blog)
> rake aborted!
> Could not find a JavaScript runtime. See
> https://github.com/sstephenson/execjs for a list of available runtimes.
> /usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in
> `autodetect'
> /usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:5:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:4:in ` (required)>'
> /usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in
> `require'
> /usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in
> `require'
> /usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:in
> `require'
> /usr/local/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:in
> `'
> /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
> `require'
> /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
> `block (2 levels) in require'
> /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
> `each'
> /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
> `block in require'
> /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
> `each'
> /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
> `require'
> /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler.rb:120:in
> `require'
> /opt/rails_3.1.0/Code/Ruby/blog/config/application.rb:7:in ` (required)>'
> :29:in `require'
> :29:in `require'
> /opt/rails_3.1.0/Code/Ruby/blog/Rakefile:5:in `'
> /usr/local/lib/ruby/1.9.1/rake.rb:2373:in `load'
> /usr/local/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
> /usr/local/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
> /usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
> /usr/local/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
> /usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run'
> /usr/local/bin/rake:31:in `'
> blog]#
>
>
>>
>> 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-talk@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.
>>
>
>
>
> --
> Ruby Student
>
> --
> 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-talk@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.
>



-- 
Leonardo Mateo.
There's no place like ~

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group,

[Rails] How to host Ruby Rails application in https .

2011-10-07 Thread Sasi
How to make my ruby on rails application to work on with https
protocol .  My application rails version - 2.3.8 . I use phusion
passenger and apache as server . Kindly help me how to make it up .

-- 
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-talk@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] Errors while installing sqlite3 for Rails

2011-10-07 Thread Ruby Student
On Thu, Oct 6, 2011 at 4:20 PM, Colin Law  wrote:

> On 6 October 2011 21:09, Ruby Student  wrote:
> > I'm sorry, I thought I said on my post that I tried the suggestion from
> the
> > failure messages.
> > Anyway, this is what I got:
> >
> > port install sqlite3 +universal
> > Command not found.
> >
> > yum install sqlite3-devel
> > Setting up Install Process
> > No package sqlite3-devel available.
> > Error: Nothing to do
> >
> > As I said before, I am running Redhat 6.1 64bit.
>
> I don't know much about redhat but googling for
> install sqlite-devel redhat
> gave a number of hits including
>
> http://www.sheepguardingllama.com/2008/11/installing-ruby-sqlite3-on-red-hat-or-centos-linux/
> That or one of the others may be helpful
>
> Colin, the link you gave me helped install sqlite3. That's fine.
However, it looks like Rails is still looking for more dependencies, which I
already installed, except that I hit one which I can't see how to address
it.
The execjs wants a javascript runtime. I installed at least three suggested
ones:

ExecJS supports these runtimes:

   - therubyracer  - Google V8
   embedded within Ruby
   - therubyrhino  - Mozilla Rhino
   embedded within JRuby
   - Johnson  - Mozilla SpiderMonkey
   embedded within Ruby
   - Mustang  - Mustang V8 embedded
   within Ruby
   - Node.js 


 and I am still having the same error messages, which I am posting below.

I am truly sorry to bother you but I hit a wall. Also, I am not sure why
Rails does not load everything it needs. It already loads a large number of
pre-reqs.

Thank you

# rake db:create
(in /opt/rails_3.1.0/Code/Ruby/blog)
rake aborted!
Could not find a JavaScript runtime. See
https://github.com/sstephenson/execjs for a list of available runtimes.
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in
`autodetect'
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:5:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:4:in `'
/usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in
`require'
/usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in
`require'
/usr/local/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:in
`require'
/usr/local/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:in
`'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
`require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
`block (2 levels) in require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
`each'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
`block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
`each'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
`require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler.rb:120:in
`require'
/opt/rails_3.1.0/Code/Ruby/blog/config/application.rb:7:in `'
:29:in `require'
:29:in `require'
/opt/rails_3.1.0/Code/Ruby/blog/Rakefile:5:in `'
/usr/local/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/local/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/local/bin/rake:31:in `'
blog]#



> 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-talk@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.
>
>


-- 
Ruby Student

-- 
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-talk@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: API request with email in address path possible?

2011-10-07 Thread Heinz Strunk
makes sense, thanks a lot for the explanation :)

-- 
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-talk@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] Recommended SOAP library

2011-10-07 Thread Leonardo Mateo
Hi guys,
I have to deal with SOAP web services.
I've been googleing around a bit, and I can see 3 major topics: Savon,
 'soap/wsdlDriver and SOAP4R.

All points that Savon is the one, but I just wanted to be sure.
Does anyone have any tip on this?

Thanks a lot in advance.

-- 
Leonardo Mateo.
There's no place like ~

-- 
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-talk@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: API request with email in address path possible?

2011-10-07 Thread Martin Wawrusch
It might be possible to pass it as part of the uri, but you do not want to
do that because it would create a second url representing the same resource.
Basically, you want to have one url per resource to make the API easy to
use, and for things that are actually queries it is better to use
parameters.

Here is a simple example to illustrate the problem by adding voting to the
user resource:

/users/1/votes
/users/email/mar...@wawrusch.com/votes

Which one is the correct one? Software developers would guess the first one,
but machines would be clueless. And you would have to implement both routes
to be consistent, then you would have to document it, and then you would
hate programming :)



On Fri, Oct 7, 2011 at 8:59 AM, Heinz Strunk  wrote:

> Oh, yeah... I actually added the /id/ part by accident. So the only way
> to pass an email is by a paramter like ...?email=xxx?
>
> --
> 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-talk@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-talk@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: API request with email in address path possible?

2011-10-07 Thread Heinz Strunk
Oh, yeah... I actually added the /id/ part by accident. So the only way 
to pass an email is by a paramter like ...?email=xxx?

-- 
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-talk@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] API request with email in address path possible?

2011-10-07 Thread Martin Wawrusch
Interesting question. First of all I think you need to change this a bit
into

/api/users/1 as the canonical url

and perhaps add a route like /api/users/search?email=youremail
which redirects to the canonical url.



On Fri, Oct 7, 2011 at 8:31 AM, Heinz Strunk  wrote:

> Hey,
>
> I'm currently implementing a API for a website which is supposed to
> support following requests:
> /api/users/id/1
> /api/users/email/t...@example.org
> ...
>
> Of course the email address with its dot causes an error because if the
> .org which is interpreted as file format.
>
> How can I pass an email address like that?
>
> Thanks for the help,
> Hans
>
> --
> 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-talk@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-talk@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] [ANN] Rails 3.1.1 has been released!

2011-10-07 Thread Santiago Pastorino
Hi everyone,

Rails 3.1.1 has been released.

## CHANGES

*ActionMailer*

* No changes


*ActionPack*

* stylesheet_link_tag('/stylesheets/application') and similar helpers doesn't
throw Sprockets::FileOutsidePaths exception anymore [Santiago Pastorino]

* Ensure default_asset_host_protocol is respected, closes #2980. [José Valim]

  Changing rake db:schema:dump to run :environment as well as :load_config,
  as running :load_config alone will lead to the dumper being run without
  including extensions such as those included in foreigner and
  spatial_adapter.

  This reverses a change made here:
  
https://github.com/rails/rails/commit/5df72a238e9fcb18daf6ab6e6dc9051c9106d7bb#L0L324

  I'm assuming here that :load_config needs to be invoked
  separately from :environment, as it is elsewhere in the
  file for db operations, if not the alternative is to go
  back to "task :dump => :environment do".

  [Ben Woosley]

* Update to rack-cache 1.1.

  Versions prior to 1.1 delete the If-Modified-Since and If-Not-Modified
  headers when config.action_controller.perform_caching is true. This has two
  problems:
* unexpected inconsistent behaviour between development &
  production environments
* breaks applications that use of these headers

  [Brendan Ribera]

* Ensure that enhancements to assets:precompile task are only run once
[Sam Pohlenz]

* TestCase should respect the view_assigns API instead of pulling variables on
its own. [José Valim]

* javascript_path and stylesheet_path now refer to /assets if asset pipelining
is on. [Santiago Pastorino]

* button_to support form option. Now you're able to pass for example
'data-type' => 'json'. [ihower]

* image_path and image_tag should use /assets if asset pipelining is turned
on. Closes #3126 [Santiago Pastorino and christos]

* Avoid use of existing precompiled assets during rake assets:precompile run.
Closes #3119 [Guillermo Iguaran]

* Copy assets to nondigested filenames too [Santiago Pastorino]

* Give precedence to `config.digest = false` over the existence of
manifest.yml asset digests [christos]

* escape options for the stylesheet_link_tag method [Alexey Vakhov]

* Re-launch assets:precompile task using (Rake.)ruby instead of Kernel.exec so
it works on Windows [cablegram]

* env var passed to process shouldn't be modified in process method. [Santiago
Pastorino]

* `rake assets:precompile` loads the application but does not initialize
it.

  To the app developer, this means configuration add in
config/initializers/* will not be executed.

  Plugins developers need to special case their initializers that are
  meant to be run in the assets group by adding :group => :assets. [José Valim]

* Sprockets uses config.assets.prefix for asset_path [asee]

* FileStore key_file_path properly limit filenames to 255 characters.
[phuibonhoa]

* Fix Hash#to_query edge case with html_safe strings. [brainopia]

* Allow asset tag helper methods to accept :digest => false option in
order to completely avoid the digest generation.
Useful for linking assets from static html files or from emails when the user
could probably look at an older html email with an older asset.
[Santiago Pastorino]

* Don't mount Sprockets server at config.assets.prefix if
config.assets.compile is false. [Mark J. Titorenko]

* Set relative url root in assets when controller isn't available for
Sprockets (eg. Sass files using asset_path). Fixes #2435 [Guillermo
Iguaran]

* Fix basic auth credential generation to not make newlines. GH #2882

* Fixed the behavior of asset pipeline when config.assets.digest and
config.assets.compile are false and requested asset isn't precompiled.
  Before the requested asset were compiled anyway ignoring that the
config.assets.compile flag is false. [Guillermo Iguaran]

* CookieJar is now Enumerable. Fixes #2795

* Fixed AssetNotPrecompiled error raised when rake assets:precompile
is compiling certain .erb files. See GH #2763 #2765 #2805 [Guillermo
Iguaran]

* Manifest is correctly placed in assets path when default assets
prefix is changed. Fixes #2776 [Guillermo Iguaran]

* Fixed stylesheet_link_tag and javascript_include_tag to respect
additional options passed by the users when debug is on. [Guillermo
Iguaran]

* Fix ActiveRecord#exists? when passsed a nil value

* Fix assert_select_email to work on multipart and non-multipart
emails as the method stopped working correctly in Rails 3.x due to
changes in the new mail gem.


*ActiveModel*

* Remove hard dependency on bcrypt-ruby to avoid make ActiveModel
dependent on a binary library.
  You must add the gem explicitly to your Gemfile if you want use
ActiveModel::SecurePassword:

  gem 'bcrypt-ruby', '~> 3.0.0'

  See GH #2687. [Guillermo Iguaran]


*ActiveRecord*

* Add deprecation for the preload_associations method. Fixes #3022.

  [Jon Leighton]

* Don't require a DB connection when loading a model that uses
set_primary_key. GH #2807.

  [Jon Leighton]

* Fix using select() with a habtm associati

[Rails] API request with email in address path possible?

2011-10-07 Thread Heinz Strunk
Hey,

I'm currently implementing a API for a website which is supposed to
support following requests:
/api/users/id/1
/api/users/email/t...@example.org
...

Of course the email address with its dot causes an error because if the
.org which is interpreted as file format.

How can I pass an email address like that?

Thanks for the help,
Hans

-- 
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-talk@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: Postgresql adapter not working

2011-10-07 Thread Luís de Sousa
On Oct 6, 6:16 pm, Romain Maz BILLOIR  wrote:
>
> Yes: to create a postgresql based application, you need to use the "-d
> postgresql" argument, if you forgot it,

One can only forget things one has learned in the past. I'll stick to
postgres-pr for now, it is recommended in several places on the web
and so far seems to work without trouble.

Luís

-- 
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-talk@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: Postgresql adapter not working

2011-10-07 Thread Luís de Sousa
That seems useful, Thank you Bob.

Luís

On Oct 6, 4:37 pm, Rob Biedenharn  wrote:
> On Oct 6, 2011, at 9:48 AM, Peter Vandenabeele wrote:
>
> tl;drhttps://gist.github.com/1261571
>
> At Gaslight Software, we are helping a group at a local high school  
> develop a simple web application and have exactly this same situation.
>
> We went with Ubuntu 10.04 LTS, Ruby 1.9.2, Rails 3.1, and PostgreSQL,  
> but the steps should be the same.
>
> Configuring Ubuntu 10.04 for Rails Development
>
> http://blog.gaslightsoftware.com/post/11027905735/configuring-ubuntu-...
>
> Our time is limited with them so we're only sure that everything gets  
> installed, but we've gotten six ubuntu workstations configured and  
> next week should actually spin up a demo rails app.
>
> -Rob
>
> Rob Biedenharn          
> r...@agileconsultingllc.com        http://AgileConsultingLLC.com/
> r...@gaslightsoftware.com          http://GaslightSoftware.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-talk@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: Postgresql adapter not working

2011-10-07 Thread Luís de Sousa
Hi Peter,

That not exactly the same issue, I'd say an authoritative install
guide for Ubuntu is definitely needed, especially since a direct
install from the repositories won't work.

I used this guide which got Rails and Ruby to work on Ubuntu 10.10 64-
bit:

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

Though it installed the pg adapter instead of the postgres-pr gem.

Luís

On Oct 6, 3:48 pm, Peter Vandenabeele  wrote:
> 2011/10/5 Luís de Sousa 
>
> > Hello again,
>
> > I managed to get rake db:create to work, it requires the creation of an
> > application with the -d postgresql argument. Nevertheless, it throws a
> > strange message saying that the database already exists. I will move onwards
> > with the tutorial to see if it really works.
>
> > I think this issue should be made clear on the tutorial; some basic
> > guidelines on which adapter to use could also be helpful.
>
> I read you use Ubuntu (am I correct ?).
>
> When googling for "install ruby on rails ubuntu"
> * the first entry points to a page on help.ubuntu.com that talks about 8.04
> and 9.04
> * the second entry points to a very short description help.ubuntu.com
> * the third page points to a broken page onhttp://wiki.rubyonrails.org/
> * and then we get into private blogs, which may be OK, but are less
> authorative
>
> I would volunteer to make a proper write-up for Ruby and Rails on Ubuntu
> 10.04
> and/or 11.10 with rvm, ruby 1.9.(2|3), postgresql, etc.
>
> Particularly I would also make clear which extra -dev Debian packages are
> needed
> for native compilation when starting from a vanilla Ubuntu (32 bit x86)
> client machine
> install.
>
> That could be similar in style to what I did on my blog for Jaunty (9.04) a
> few years agohttp://vandenabeele.com/Rails-on-Ubuntu-Jaunty
>
> My goal is to put a correct how-to in the place that is most easily found by
> newcomers
> that are working on Ubuntu.
>
> Maybe most efficient would be to update the number 1 hit that is the Ubuntu
> help Wiki.
>
> Would this be useful, or is this problem solved and did I just not find the
> correct
> pointers by googling? (in that case, I could update the wiki to point there
> or copy
> the correct description on the Ubuntu help Wiki).
>
> Thanks for your feedback,
>
> Peter

-- 
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-talk@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] will_paginate + RJS error

2011-10-07 Thread Pedro
Hi there!
I need some help, I'm new to rjs + will_paginate and don't know how
to
solve this problem.
The application apparently is working fine, the partial is rendered
by the javascript, the pagination works fine, but sometimes, when I
hit the next page number or " next >>", it reders the  code below.
Im using rails 2.3.8, ruby 1.8.7. and will_paginate 2.3.15
Thanks!
try { Element.update("search_professors", "
Professors  List
\n
\n\n\n\n\n\n  \nName Address Action \n
\n \n  \n \n\n \n \n   \n  John  \n  \n \n  \n
\n \n  \n \n\n \n \n   \n  Carl \n\n  \n \n  \n
\n \n\n \n\n\n \n \n
\n
\n \n
\n\n
\n
\n
<< prev 1 2 next >>
\n
\n\n"); } catch (e) { alert('RJS error:\n\n' + e.toString());
alert('Element.update(\"search_professors\", \"
Professors  List
\n
\n\n\n\n\n\n  \nName Address Action \n
\n \n  \n \n\n \n \n   \n  John  \n  \n \n  \n
\n \n  \n \n\n \n \n   \n  Carl \n\n  \n \n  \n
\n \n\n \n\n\n \n \n
\n
\n \n
\n\n
\n
\n
<< prev 1 2 next >>
\\n
\\n \\n
\\n\\n
\\n
\\n
<< prev 1 2 next >>
\\n
\\n\\n\");'); throw e }
My Controller:
def search_professors
  begin
   @professors =
User.search_for(params[:search]).paginate(:all,:conditions =>
{:professor => true},:page => params[:page], :per_page => 8)
  rescue => e
   flash[:error] = e.to_s
   @professors= User.search_for '*'
  end
   respond_to do |format|
  format.html
  format.js
end
end
The view:
  <% tabnav :user do%>
  <% form_remote_tag :url => 'search_professors' do %>
  <%= text_field_tag :search, params[:search], :value => nil %>
  <%= submit_tag "Go", :name => nil , :disable_with => "Please
wait..."%>
  <%end%>
  
  <%= render :partial => "course/professors_list" %>
  
  
  <% end %>
The partial inside the view:
 Professors  List
<% form_tag('/user/email_professors', :method => :post) do%>
 <% if !...@professors.empty? %>

   
 Name Address Action
   
  <% @professors.each do |professor| %>

 <% if !professor.nil? %>
   <%= check_box_tag
"user_emails[]" , professor.email  %>  
 <% end %>
 <%=image_tag   professor.photo.url(:mini) %>
   <%= professor.spec.full_name %>
   <%= professor.address.address %>


<% end %>
 
  <% else %>
   
   No results!
   
  <% end %>
<% end %>
   
<%= will_paginate @professors %>
   
My JavaScript file
search_professors.rjs
page.replace_html :search_professors, :partial => "course/
professors_lista", :object => @users

-- 
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-talk@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: Inexpensive Rails Hosting for Small Business Client

2011-10-07 Thread Danaka Kahn
On Fri, Oct 7, 2011 at 8:44 AM, Martin Wawrusch  wrote:

> No, it is 0. There website is confusing, they are aware of this and are
> hopefully clarifying this,
>
>
> On Fri, Oct 7, 2011 at 5:39 AM, trans  wrote:
>
>>
>>
>> On Oct 6, 5:18 pm, jason white  wrote:
>> > depending on the level of traffic, i recommend heroku
>>
>> I've heard this recommendation before, but isn't the minimum cost of
>> heroku $36/mo ?
>>
>
Yeah - they are $0 to get started, then you pay to increase
bandwidth/throughput. I am not sure how it goes if you start getting a lot
of volume in terms of how the cost of heroku compares to others, but for the
sheer ease and slickness of easy deployments, creating multiple environments
(such as staging vs production), automated backups available (at least for
pg), and so much more, unless someone has a specific reason not to use them,
heroku is amazing. I hope their model is the general wave of the future, at
least for us who would rather create functionality than configure boxes.


>
>> --
>> 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-talk@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-talk@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-talk@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] Rails 3.1 string conversion errors

2011-10-07 Thread Rick
I'm seeing many errors when installing Rails 3.1 and other gems.
These are all showing up in the ri/rdoc portion of the install
sequence and look like this:


gem install rdoc
Depending on your version of ruby, you may need to install ruby rdoc/
ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed rdoc-3.9.4
1 gem installed
Installing ri documentation for rdoc-3.9.4...
unable to convert U+201D from UTF-8 to US-ASCII for lib/rdoc/text.rb,
skipping
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to
UTF-8 to US-ASCII for History.txt, skipping
Installing RDoc documentation for rdoc-3.9.4...
unable to convert U+201D from UTF-8 to US-ASCII for lib/rdoc/text.rb,
skipping
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to
UTF-8 to US-ASCII for History.txt, skipping


ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]

Any idea what's going on?

thanks in advance
Rick

-- 
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-talk@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: Redmine MySQL rake command issue

2011-10-07 Thread Andre Flory
Thanks guys for your responses and I appologize for the delay in getting 
back here, I only work on this once a week. I just got past that error, 
it was a problem with my password, inside my database file for redmine, 
database.yml.

Now I am getting this error:

C:\redmine-1.2.1>rake db:migrate RAILS_ENV=production
NOTE: SourceIndex.new(hash) is deprecated; From 
C:/redmine-1.2.1/config/../vendo
r/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 
'task :t, [
args] => [deps]' instead.
at C:/redmine-1.2.1/lib/tasks/email.rake:170
rake aborted!
Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` 
(`version`
varchar(255) NOT NULL) ENGINE=InnoDB

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

C:\redmine-1.2.1>rake db:migrate RAILS_ENV=production


btw, I am using Windows XP, so there is no bash etc.

-- 
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-talk@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: Inexpensive Rails Hosting for Small Business Client

2011-10-07 Thread Martin Wawrusch
No, it is 0. There website is confusing, they are aware of this and are
hopefully clarifying this,

On Fri, Oct 7, 2011 at 5:39 AM, trans  wrote:

>
>
> On Oct 6, 5:18 pm, jason white  wrote:
> > depending on the level of traffic, i recommend heroku
>
> I've heard this recommendation before, but isn't the minimum cost of
> heroku $36/mo ?
>
> --
> 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-talk@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-talk@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: Inexpensive Rails Hosting for Small Business Client

2011-10-07 Thread trans


On Oct 6, 5:18 pm, jason white  wrote:
> depending on the level of traffic, i recommend heroku

I've heard this recommendation before, but isn't the minimum cost of
heroku $36/mo ?

-- 
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-talk@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: 403 Error Dont know whats wrong.

2011-10-07 Thread Frederick Cheung


On Oct 7, 10:01 am, "Kaushalya K."  wrote:
> Hi,
>
> I am quite new to ruby and am programming an application to send sms
> using rest_client gem. I so far have code on one of my modules which
> tries to send an sms to a number. It gives the 403 error -
>
> RestClient::Forbidden in SMSController#index
>
> 403 Forbidden
> Rails.root: /Users/user1/Desktop/rails_projects/sms_app
>
> My code in the module looks as follows - before adding this code i had a
> simple enter number and enter message text boxes with the usual
> edit/add/delete options.
>
> require 'rubygems'
> require 'rest_client'
>
> class SMS < ActiveRecord::Base
>
>       API_URL = 'http://services..com/SMS'
>       API_KEY = '0'
>       RestClient.post 'API_URL/TXT//07996750812/wakeup/API_KEY',
> :number => '079945460812', :nested => { :message => 'working   from
> inside' }
>     RestClient.get 'https://...@gmail.com:password@API_URL'
> end
>
> My user name is in the form of an email. let me what you think the
> problem would be. thanks :)

First off, it's a bit odd to be making those calls to restclient where
you're making them - they'll happen when the class gets loaded, which
isn't really under your control.

Secondly you don't seem to be using ruby's interpolation properly -
API_URL isn't getting replaced by the value of that constant

Lastly, @ is a special character in a url (since it marks the
separation between the end of the password and the rest of the url),
so you'll need to escape the literal @ in your username (I'd be
surprised if there wasn't a way in rest client to just supply a
username and password rather than have to do that mangling yourself)

Fred

>
> --
> 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-talk@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 dynamic values in popup box

2011-10-07 Thread Pab


there is no problem with my code if i try that with some partial
page,  data listed perfectly, but only in case of popbox data is not
displayed

thanks
-pab

-- 
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-talk@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: problem with dynamic values in popup box

2011-10-07 Thread Colin Law
On 7 October 2011 07:56, Pab  wrote:
>
>
> well it will show the size of the array..

Is that supposed to be an answer to one of the questions previously
asked?  You have given no indication of which one, nor have you
answered some other questions.

Please reply again to whichever post you are replying and insert your
message inline at appropriate points in the previous post so that we
can see what you are replying to.

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-talk@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 in SessionHelper

2011-10-07 Thread Frederick Cheung


On Oct 2, 6:54 pm, rails_learner  wrote:
>         def sign_out
>                 cookies.delete (:remember_token)
>                 self.current_user = nil
>         end
>
> private
>
>         def user_from_remember_token
>         User.authenticate_with_salt (*remember_token)
>         end

You shouldn't use spaces between a method name and its (

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-talk@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] 403 Error Dont know whats wrong.

2011-10-07 Thread Kaushalya K.
Hi,

I am quite new to ruby and am programming an application to send sms
using rest_client gem. I so far have code on one of my modules which
tries to send an sms to a number. It gives the 403 error -

RestClient::Forbidden in SMSController#index

403 Forbidden
Rails.root: /Users/user1/Desktop/rails_projects/sms_app

My code in the module looks as follows - before adding this code i had a
simple enter number and enter message text boxes with the usual
edit/add/delete options.

require 'rubygems'
require 'rest_client'

class SMS < ActiveRecord::Base

  API_URL = 'http://services..com/SMS'
  API_KEY = '0'
  RestClient.post 'API_URL/TXT//07996750812/wakeup/API_KEY',
:number => '079945460812', :nested => { :message => 'working   from
inside' }
RestClient.get 'https://y...@gmail.com:password@API_URL'
end

My user name is in the form of an email. let me what you think the
problem would be. 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-talk@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.