On 21 April 2014 22:14, abarrero90 <[email protected]> wrote:
> I'm not using any gem, I did by myself the login method. Could you tell me
> any gem?

Read the reply by Robert Walker in this thread on 16th April.  Also
google can be very helpful.  You are more likely to get help here if
you give the impression of having tried to answer questions yourself
before asking us to spend our time trying to help.

Colin

>
> Thanks.
>
>
> -------- Original message --------
> From: Colin Law
> Date:21/04/2014 23:03 (GMT+01:00)
> To: [email protected]
> Subject: Re: [Rails] Re: Push user.id to another Controller
>
> On 21 April 2014 21:46, Alfredo Barrero <[email protected]> wrote:
>> Ok I think there is another easy way. What I'm trying to do now is send
>> the
>> id of the user that is trying to upload a new photo to the form
>> "new_photo".
>> That form has the id of the user but when the "submit" is selected the id
>> get lost.
>>
>> The other way to get the user_id is with the "set_user", but I don't know
>> exactly how it works. I'm reading a few blogs and when the user login to
>> the
>> web the application has to save the user_id. Then, any controller can has
>> that id.
>>
>> Could you please explain to me this way?.
>
> What gem (if any) are you using to provide user login?  Most have a
> current_user method or similar that will give you the current user so
> you don't need to pass it around at all.
>
> Colin
>
>>
>> Thank you & Best regards,
>>
>> Alfredo.
>>
>> El martes, 15 de abril de 2014 11:12:11 UTC+2, Alfredo Barrero escribió:
>>>
>>> Good morning everyone,
>>>
>>> I have a question, if anyone can answer it would be great. I'm trying to
>>> send the user.id from the "users/show.html.erb" to
>>> "photos_controller.rb",
>>> but I'm not sure how to do it. I can send the user information to the
>>> Model
>>> but I'm not sure is that is correct.
>>>
>>> Below is the code that I'm using:
>>>
>>> "users/show.html.erb"   -->   <%= link_to 'Add Photo', :method =>
>>> Photo.add(@user) %>
>>>
>>> "photo.rb" -->
>>> def self.add (name)
>>>     puts 'Adding photo'
>>>     print name.name
>>>   end
>>>
>>> Thi other thing that I'm trying is the next one. Could you tell me if it
>>> is correct?
>>>
>>> "users/show.html.erb"   -->   <%= link_to 'Add Photo', new_photo_path,
>>> :id
>>> => @user.id %>
>>>
>>> Thanks & Best regards
>>>
>>> Alfred
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>>
>> https://groups.google.com/d/msgid/rubyonrails-talk/ddd70b5b-b3b1-480e-a4bd-235b68a352a8%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/rubyonrails-talk/3K-14GwoqhE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
>
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuJvzM_K0zPxHAyoQ%2B6Q9EkVN9peSLEXwS6_yROfSigRQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/xoycrdfo77ip1av6j2dx2e1n.1398114871836%40email.android.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvSt7Rjs4EP76PUB%3DG3COew4k_hsNw_HqqE6ZLBF0zapQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to