[Rails] Re: How to edit each line of a file in ruby, without using a temp file

2012-10-07 Thread ni ed
Thank you very much for the help.

-- 
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 https://groups.google.com/groups/opt_out.




[Rails] dup/clone and taintedness

2012-10-07 Thread John Merlino
I was reading this:

"these methods allocate a new instance of the class of the object on
which they are invoked. They then copy all the instance variables and
the taintedness of the receiver object to the newly allocated object."

What does it mean "taintedness"?

thanks for response

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Re: routing issue, matching a param as action

2012-10-07 Thread Ignacio Piantanida
You could do something like this:

match '/auth/:provider/callback', to: 'omniauth_callbacks#all_callbacks'

class OmniauthCallbacksController
  def all_callbacks
send(params[:provider])
  end

  def facebook

  end

  def twitter
...
  end

  def method_missing(method_name, *args, &block)
#do some stuff
  end
end

2012/10/7 Erwin 

> It seems in some cases I can use the redirect
>
>match '/auth/:provider/callback', :to => redirect {|params| "/
> omniauth_callbacks/#{params[:provider]}" }
>
> but not in this case , as the redirect will change the request , and
> I'll not be able to check for   request.env["omniauth.auth"]
>
> so I resolved to write one match for each :provider .
>   match '/auth/google_oauth2/callback', to:
> 'omniauth_callbacks#google_oauth2'
>   match '/auth/facebook/callback', to: 'omniauth_callbacks#facebook'
>   match '/auth/twitter/callback', to: 'omniauth_callbacks#twitter'
>
>
> On 7 oct, 11:07, Erwin  wrote:
> > I have the following routes :
> >
> > >>  match '/auth/:provider/callback', to: 'omniauth_callbacks#create'
> >
> > I can test the :provider in the create action ..
> >
> > is there any way to directly match to an action with the :provider
> > name ?
> >
> >
> >
> >
> >
> >
> >
> > >> match '/auth/:provider/callback', to:
> 'omniauth_callbacks#(:provider)' ...
>
> --
> 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 https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To 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 https://groups.google.com/groups/opt_out.




Re: [Rails] "Not Selected"-dropdown-list-option

2012-10-07 Thread Walter Lee Davis

On Oct 6, 2012, at 4:47 PM, DONEIN NET wrote:

> I am having a similar issue.
> 
> I figured out to add a blank item to the top of the list.  But then when 
> I go back in to edit mode, it gets upset because it doesn't exist in the 
> collection.

Have a look at the :prompt option for the select and collection_select methods. 
Using that to create your "Not selected" option would be trivial.

Walter


-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Norbert Melzer
2012/10/7 Mandeep Kaur :

> Not getting.

Not getting what? What did you expect to get, and what are you getting instead?

"Doesn't work" or similar are the worst descriptions of an error or
missbehaviour I am aware off.

We can only help you, if you give appropriate reports or questions.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Mandeep Kaur
On Sun, Oct 7, 2012 at 8:06 PM, Hassan Schroeder
 wrote:
> On Sun, Oct 7, 2012 at 7:20 AM, Mandeep Kaur  wrote:
>
>> ** [deploy:update_code] exception while rolling back:
>> Capistrano::ConnectionError, connection failed for: mandeep
>> (Net::SSH::AuthenticationFailed: mandy)
>>
>> How to solve this?
>
> Ideally, install your ssh keys on your server so you can login (and
> use capistrano) without being prompted for a password.
>

Not getting.

-- 
Mandeep Kaur
http://mandeepsimak.wordpress.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 https://groups.google.com/groups/opt_out.




[Rails] Re: routing issue, matching a param as action

2012-10-07 Thread Erwin
It seems in some cases I can use the redirect

   match '/auth/:provider/callback', :to => redirect {|params| "/
omniauth_callbacks/#{params[:provider]}" }

but not in this case , as the redirect will change the request , and
I'll not be able to check for   request.env["omniauth.auth"]

so I resolved to write one match for each :provider .
  match '/auth/google_oauth2/callback', to:
'omniauth_callbacks#google_oauth2'
  match '/auth/facebook/callback', to: 'omniauth_callbacks#facebook'
  match '/auth/twitter/callback', to: 'omniauth_callbacks#twitter'


On 7 oct, 11:07, Erwin  wrote:
> I have the following routes :
>
> >>  match '/auth/:provider/callback', to: 'omniauth_callbacks#create'
>
> I can test the :provider in the create action ..
>
> is there any way to directly match to an action with the :provider
> name ?
>
>
>
>
>
>
>
> >> match '/auth/:provider/callback', to: 'omniauth_callbacks#(:provider)' ...

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Hassan Schroeder
On Sun, Oct 7, 2012 at 7:20 AM, Mandeep Kaur  wrote:

> ** [deploy:update_code] exception while rolling back:
> Capistrano::ConnectionError, connection failed for: mandeep
> (Net::SSH::AuthenticationFailed: mandy)
>
> How to solve this?

Ideally, install your ssh keys on your server so you can login (and
use capistrano) without being prompted for a password.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
http://about.me/hassanschroeder
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-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Mandeep Kaur
On Sun, Oct 7, 2012 at 7:46 PM, Hassan Schroeder
 wrote:
> On Sun, Oct 7, 2012 at 6:41 AM, Mandeep Kaur  wrote:
>
>> Here i have confusion about repository. Its github repository or something 
>> else?
>
> It's the repository for your code.
>

Done!
This is solved.

But getting another error of

** [deploy:update_code] exception while rolling back:
Capistrano::ConnectionError, connection failed for: mandeep
(Net::SSH::AuthenticationFailed: mandy)

How to solve this?

-- 
Mandeep Kaur
http://mandeepsimak.wordpress.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 https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Hassan Schroeder
On Sun, Oct 7, 2012 at 6:41 AM, Mandeep Kaur  wrote:

> Here i have confusion about repository. Its github repository or something 
> else?

It's the repository for your code.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
http://about.me/hassanschroeder
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-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Mandeep Kaur
On Sun, Oct 7, 2012 at 7:11 PM, Mandeep Kaur  wrote:

> Here i have confusion about repository. Its github repository or something 
> else?

I have solved this but getting anther error.

Check this

** [deploy:update_code] exception while rolling back:
Capistrano::ConnectionError, connection failed for: mandeep
(Net::SSH::AuthenticationFailed: mandy)
connection failed for: mandeep (Net::SSH::AuthenticationFailed: mandy)

How can i solve this?

-- 
Mandeep Kaur
http://mandeepsimak.wordpress.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 https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Mandeep Kaur
On Sun, Oct 7, 2012 at 6:55 PM, Hassan Schroeder
 wrote:
> On Sun, Oct 7, 2012 at 6:00 AM, Mandeep Kaur  wrote:
>
>>  ** transaction: start
>>   * executing `deploy:update_code'
>> Please specify the repository that houses your application's code, set
>> :repository, 'foo'
>
> Have you tried doing what the error message tells you to do?
>
> At least, that's where I would start :-)

Here i have confusion about repository. Its github repository or something else?



-- 
Mandeep Kaur
http://mandeepsimak.wordpress.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 https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Hassan Schroeder
On Sun, Oct 7, 2012 at 6:00 AM, Mandeep Kaur  wrote:

>  ** transaction: start
>   * executing `deploy:update_code'
> Please specify the repository that houses your application's code, set
> :repository, 'foo'

Have you tried doing what the error message tells you to do?

At least, that's where I would start :-)

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
http://about.me/hassanschroeder
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-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-07 Thread Mandeep Kaur
On Mon, Oct 1, 2012 at 7:51 PM, Jordon Bedwell  wrote:

> Yes, Capistrano can be setup to do whatever you want, including
> provisioning servers, though personally I prefer to deploy to a
> central server via Git then that server is designed to deploy, manage,

I have tried it with Capistrano. I have installed it properly and also
configured it.
But when I open domain(mandeep) in browser it shows message:
We're sorry, but something went wrong.

What does it mean?
Rails application is started or not?

Result of cap deploy
$ cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
Please specify the repository that houses your application's code, set
:repository, 'foo'
*** [deploy:update_code] rolling back
  * executing "rm -rf /u/apps/mysite/releases/20121007124955; true"
servers: ["mandeep"]
Password:
[mandeep] executing command
command finished in 229ms

Check Its correct or not.


-- 
Mandeep Kaur
http://mandeepsimak.wordpress.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 https://groups.google.com/groups/opt_out.




[Rails] Re: [ANN] Jail : Put all your Assets in Rails !

2012-10-07 Thread Charly
Quick note to say the cdnjs libraries have been integrated to the Jail 
gem(version 0.1.1). 
That's a whooping 158 more 
javascripts
.

On Wednesday, October 3, 2012 9:41:40 AM UTC+2, Charly wrote:
>
> Copying, pasting, 'curling', running after all those jquery-plugin files, 
> trying to keep track, loosing them, pulling your hair off. This must stop ! 
> Put all your jquery plugins (or any other assets) in rails once and for 
> all
> . 
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/9LxwSyGBq5sJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] paperclip gem question.

2012-10-07 Thread BalaRaju Vankala
Hi...
1.  in Gemfile add  this gem

gem "paperclip", "3.1.4"

2. bundle install
3.after creating model add below code in migration file(db->migrate->photo
model migration file )

t.attachment:photo

4. rake db:migrate

5. in your model Add this code
attr_accessible: photo

has_attached_file :photo
   :path=>"rails_root/public/system/:attachment/:id/:style/:filename",
   :url=> "system/:attachment/:id/:style/:filename"




On Sat, Oct 6, 2012 at 9:10 PM, roelof  wrote:

> Hello,
>
> I decided that I use paperclip to handle my images.
>
> I have this model for posts
>
> class Micropost < ActiveRecord::Base
>   attr_accessible :content, :user_id
> belongs_to :user
> end
>
> So according to the manual I have to do this :
> has_attached_file :photo
>
> But :photo is never used anywhere.
>
> So do I have to change something or did I misunderstand the manual.
>
> Roelof
>
>  --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/is2_0907w1QJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
నేను
కొంచం తపన,
 కాస్త ఆసక్తి,
కొన్ని కలలు,
 కాసిన్ని ఊహలు కలిపేస్తే
 నేను

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To 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 https://groups.google.com/groups/opt_out.




[Rails] routing issue, matching a param as action

2012-10-07 Thread Erwin
I have the following routes :

>>  match '/auth/:provider/callback', to: 'omniauth_callbacks#create'

I can test the :provider in the create action ..

is there any way to directly match to an action with the :provider
name ?

>> match '/auth/:provider/callback', to: 'omniauth_callbacks#(:provider)' ...

-- 
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 https://groups.google.com/groups/opt_out.




[Rails] Re: how to scope the /auth/:provider/callback , using OmniAuth for users and members

2012-10-07 Thread Erwin
[SOLVED] maybe not the best way, but it runs ..
using only one callback url, I can test the
request.env["omniauth.origin"]  which can be tested :

"http://lvh.me:3000/en/users/sign_in";
or
"http://acme.lvh.me:3000/en/members/sign_in";  ( in this cas I can even
test for current_subdomain.nil?




On 6 oct, 19:06, Erwin  wrote:
> I have two separate groups of people authenticated w Devise , but in
> this case I cannot used the Devise embedded OmniAuth support. So i am
> using directly the OmniAuth gem.
>
> Initialized w :
> Rails.configuration.middleware.use OmniAuth::Builder do
> ..provider :twitter,
> ..
> end
>
> It's running fine , but I have an issue with the callback route
> mapping :
>
> I tried
>     match '/users/auth/:provider/callback', to: 'users/
> omniauth_callbacks#create'
>     match '/members/auth/:provider/callback', to: 'members/
> omniauth_callbacks#create'
> but the provider ( fb , twitter, google)  claimebd about the callback
> uri :
>  "/auth/:provider/callback"
> ..
> as the path_prefix (:path_prefix => "/auth" )  is set in the
> initializer , I have no mean to modify it dynamically...
>
> any clue ? or feedback from previous experiences...
>
> 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-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.