Good morning everyone. 

Sorry for beign late, I have been traveling. I'm in Singapore actually. 

I have been working on Git these past days, and here is the code on 
github.https://github.com/abarrero90/TravelTime

I have two questions already:

1) Could you check if this line is OK?. "users/user.html.erb" ==> <%= 
button_to 'Add Photo' , home_add_path(user_id: @user) %>
2) I just add the gem "paperclip". I want this gem to upload all the photos 
that the user will have on his page on my server. 


Thank you so much. 

Alfredo.


El martes, 4 de marzo de 2014 23:03:18 UTC+8, Carlos Figueiredo escribió:
>
> Put your code on github. It could be a good oportunity to you train git, 
> and for us, is an easier way to know what the context of your problem...
>
> First, I recommend to read that: 
> http://guides.rubyonrails.org/routing.html
>
> Second... try plan better your routes. It's not related with your 
> currently problem at all... but do you agree that it's a bit odd to add a 
> home for a photo? Does it not look natural to add a photo to an user? 
> so... looks more natural a route like :user/photo/add translated to 
> user_photo_add(@user)
>
>
>
> On Tue, Mar 4, 2014 at 6:04 AM, Colin Law <[email protected] 
> <javascript:>>wrote:
>
>> On 3 March 2014 19:57, Alfredo Barrero <[email protected] <javascript:>> 
>> wrote:
>> > Good night everyone,
>> >
>> > My name is Alfredo Barrero and I'm getting started with RoR. I have been
>> > learning with "Agile Web Development".
>> >
>> > Now I'm trying to do my own web application. I have a problem and I 
>> don't
>> > know what I'm doing wrong, could you please give me a hand?.
>> >
>> > This is what I'm trying to do:
>> >
>> > <%= button_to 'Add Photo' , home_add_path(user_id: user) %>
>> >
>> > I have this line on "routes.rb" => get '/home/add' => 'photos#add', but 
>> the
>> > browser gives me this error
>> >
>> > undefined local variable or method `user' for
>> > #<#<Class:0x007fe075485dc0>:0x007fe0738e8d38>
>> >
>> > The question is, how can I call a method from a html.erb?.
>>
>> Your book should tell you how to setup data in a controller for access
>> from a view, using @variables.
>>
>> Colin
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtcO8P1JBumJ6mP7yhPHS7cytHB9h3-h2WR0ykHV3ZKug%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [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/f4da0402-d3a8-43f0-86aa-12376fff07d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to