Hi
I am on Rails 1.2.6, but want to get my app running without warning''s
so i can move to 2.0.2.
I''m currently getting the folowing warning:
"has_avatar? is deprecated and will be removed from Rails 2.0 (use !
avatar insead)"
This is my view code:
<% if @user.has_avatar? %>
<p>You already have an Avatar!</p>
<% else %>
<h2>Upload Avatar:</h2>
<%= error_messages_for :avatar %>
<% form_for(:avatar, :url => user_avatars_path,
:html => { :multipart => true }) do |f| -%>
<p>
Select File:
<%= f.file_field :uploaded_data %>
</p>
<p>
<%= submit_tag ''Add Avatar'' %>
</p>
<% end -%>
<% end %>
I am not sure how to modify the code correctly.
Any help appreciated...
PJ.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Can you copy and paste the exact error please with any backtrace On Jan 14, 2008 2:20 PM, PJAY79 <pjay1979-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> > Hi > > I am on Rails 1.2.6, but want to get my app running without warning''s > so i can move to 2.0.2. > > I''m currently getting the folowing warning: > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > avatar insead)" > > This is my view code: > > <% if @user.has_avatar? %> > > <p>You already have an Avatar!</p> > > <% else %> > > <h2>Upload Avatar:</h2> > <%= error_messages_for :avatar %> > > <% form_for(:avatar, :url => user_avatars_path, > :html => { :multipart => true }) do |f| -%> > <p> > Select File: > <%= f.file_field :uploaded_data %> > </p> > <p> > <%= submit_tag ''Add Avatar'' %> > </p> > <% end -%> > > <% end %> > > I am not sure how to modify the code correctly. > > Any help appreciated... > > PJ. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Ryan, this is the output i get from the console, it''s not really an
error, everything actually works, i just want it to work without
getting the deprecated warning!
Processing AvatarsController#new (for 127.0.0.1 at 2008-01-14
21:13:37) [GET]
Session ID: e78fd9233bca38db1b5474e1aa067236
Parameters: {"action"=>"new",
"controller"=>"avatars",
"user_id"=>"1"}
[4;36;1mAvatar Columns (0.017000) [0m [0;1mSHOW FIELDS FROM
avatars [0m
[4;35;1mUser Columns (0.009000) [0m [0mSHOW FIELDS FROM
users [0m
[4;36;1mUser Load (0.005000) [0m [0;1mSELECT * FROM users WHERE
(users.`id` = 1) LIMIT 1 [0m
[4;35;1mUser Load (0.000000) [0m [0mSELECT * FROM users WHERE
(users.`id` = 1) [0m
Rendering within layouts/cool
Rendering avatars/new
DEPRECATION WARNING: has_avatar? is deprecated and will be removed
from Rails 2.0 (use !avatar insead) See http://www.rubyonrails.org/deprecation
for details. (called from _run_rhtml_47app47views47avatars47new46rhtml
at C:/InstantRails/rails_apps/socialnewsone/app/views/avatars/
new.rhtml:1)
[4;36;1mAvatar Load (0.001000) [0m [0;1mSELECT * FROM avatars
WHERE (avatars.user_id = 1) LIMIT 1 [0m
[4;35;1mRole Columns (0.015000) [0m [0mSHOW FIELDS FROM
roles [0m
[4;36;1mRole Load (0.001000) [0m [0;1mSELECT * FROM roles INNER
JOIN roles_users ON roles.id = roles_users.role_id WHERE
(roles_users.user_id = 1 ) AND (roles.`name` = ''Admin'') LIMIT
1 [0m
Completed in 0.44800 (2 reqs/sec) | Rendering: 0.10700 (23%) | DB:
0.04800 (10%) | 200 OK [http://localhost/users/1/avatars/new]
Thanks,
PJ.
On Jan 14, 2:54 pm, "Ryan Bigg"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Can you copy and paste the exact error please with any backtrace
>
> On Jan 14, 2008 2:20 PM, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
>
>
>
>
> > Hi
>
> > I am on Rails 1.2.6, but want to get my app running without
warning''s
> > so i can move to 2.0.2.
>
> > I''m currently getting the folowing warning:
>
> > "has_avatar? is deprecated and will be removed from Rails 2.0
(use !
> > avatar insead)"
>
> > This is my view code:
>
> > <% if @user.has_avatar? %>
>
> > <p>You already have an Avatar!</p>
>
> > <% else %>
>
> > <h2>Upload Avatar:</h2>
> > <%= error_messages_for :avatar %>
>
> > <% form_for(:avatar, :url => user_avatars_path,
> > :html => { :multipart => true }) do |f|
-%>
> > <p>
> > Select File:
> > <%= f.file_field :uploaded_data %>
> > </p>
> > <p>
> > <%= submit_tag ''Add Avatar'' %>
> > </p>
> > <% end -%>
>
> > <% end %>
>
> > I am not sure how to modify the code correctly.
>
> > Any help appreciated...
>
> > PJ.
>
> --
> Ryan Bigghttp://www.frozenplague.net
> Feel free to add me to MSN and/or GTalk as this email.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Praveen Jayarajan wrote:> Hi > > I am on Rails 1.2.6, but want to get my app running without warning''s > so i can move to 2.0.2. > > I''m currently getting the folowing warning: > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > avatar insead)"That''s a pretty odd deprecation notice. There''s no "avatar" methods in Rails. Perhaps you have deprecated code inside your has_avatar? method? Could you post the contents of that method? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 14 Jan 2008, at 11:01, Daniel Waite wrote:> > Praveen Jayarajan wrote: >> Hi >> >> I am on Rails 1.2.6, but want to get my app running without warning''s >> so i can move to 2.0.2. >> >> I''m currently getting the folowing warning: >> >> "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! >> avatar insead)" > > That''s a pretty odd deprecation notice. There''s no "avatar" methods in > Rails. Perhaps you have deprecated code inside your has_avatar? > method? > Could you post the contents of that method?Not really: if you have an association you used to get a has_foo? method. Rails is telling you that has_foo? is going away and that you should just test whether foo is nil or not. Fred> > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> Not really: if you have an association you used to get a has_foo? > method. Rails is telling you that has_foo? is going away and that you > should just test whether foo is nil or not.Ah, interesting. I was not aware of that. Thanks for the heads up. I do know that Rails gives you #attribute_name? methods. Say User objects have a name attribute, you get name? returning true is the object/db contains a non-nil value. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I established the relationship between the User and Avatar models as follow: User has_one :avatar Avatar belongs_to :user That was it really...is it something to do with this...? PJ. On Jan 14, 10:01 pm, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Praveen Jayarajan wrote: > > Hi > > > I am on Rails 1.2.6, but want to get my app running without warning''s > > so i can move to 2.0.2. > > > I''m currently getting the folowing warning: > > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > > avatar insead)" > > That''s a pretty odd deprecation notice. There''s no "avatar" methods in > Rails. Perhaps you have deprecated code inside your has_avatar? method? > Could you post the contents of that method? > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
and, how do i fix this, in newbie terms...?! Pj. On Jan 14, 10:30 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> I established the relationship between the User and Avatar models as > follow: > > User > has_one :avatar > > Avatar > belongs_to :user > > That was it really...is it something to do with this...? > > PJ. > > On Jan 14, 10:01 pm, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Praveen Jayarajan wrote: > > > Hi > > > > I am on Rails 1.2.6, but want to get my app running without warning''s > > > so i can move to 2.0.2. > > > > I''m currently getting the folowing warning: > > > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > > > avatar insead)" > > > That''s a pretty odd deprecation notice. There''s no "avatar" methods in > > Rails. Perhaps you have deprecated code inside your has_avatar? method? > > Could you post the contents of that method? > > -- > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 14 Jan 2008, at 11:32, PJAY79 wrote:> > and, how do i fix this, in newbie terms...?! >You need to do exactly what the deprecation message says: don''t use has_avatar? <% if @user.has_avatar? %> ... becomes <% if @user.avatar %>> Pj. > > On Jan 14, 10:30 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: >> I established the relationship between the User and Avatar models as >> follow: >> >> User >> has_one :avatar >> >> Avatar >> belongs_to :user >> >> That was it really...is it something to do with this...? >> >> PJ. >> >> On Jan 14, 10:01 pm, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >> wrote: >> >>> Praveen Jayarajan wrote: >>>> Hi >> >>>> I am on Rails 1.2.6, but want to get my app running without >>>> warning''s >>>> so i can move to 2.0.2. >> >>>> I''m currently getting the folowing warning: >> >>>> "has_avatar? is deprecated and will be removed from Rails 2.0 >>>> (use ! >>>> avatar insead)" >> >>> That''s a pretty odd deprecation notice. There''s no "avatar" >>> methods in >>> Rails. Perhaps you have deprecated code inside your has_avatar? >>> method? >>> Could you post the contents of that method? >>> -- >>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you very much Frederick :) PJ. On Jan 14, 10:45 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 14 Jan 2008, at 11:32, PJAY79 wrote: > > > > > and, how do i fix this, in newbie terms...?! > > You need to do exactly what the deprecation message says: don''t use > has_avatar? > > <% if @user.has_avatar? %> > ... > > becomes > > <% if @user.avatar %> > > > Pj. > > > On Jan 14, 10:30 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > >> I established the relationship between the User and Avatar models as > >> follow: > > >> User > >> has_one :avatar > > >> Avatar > >> belongs_to :user > > >> That was it really...is it something to do with this...? > > >> PJ. > > >> On Jan 14, 10:01 pm, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > >> wrote: > > >>> Praveen Jayarajan wrote: > >>>> Hi > > >>>> I am on Rails 1.2.6, but want to get my app running without > >>>> warning''s > >>>> so i can move to 2.0.2. > > >>>> I''m currently getting the folowing warning: > > >>>> "has_avatar? is deprecated and will be removed from Rails 2.0 > >>>> (use ! > >>>> avatar insead)" > > >>> That''s a pretty odd deprecation notice. There''s no "avatar" > >>> methods in > >>> Rails. Perhaps you have deprecated code inside your has_avatar? > >>> method? > >>> Could you post the contents of that method? > >>> -- > >>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
There are a couple other things deprecated in 2.0 that cause compiler crashes (although they work in 1.2): namely "@params" and "@request", which should be replaced with "params" and "request". It''s mentioned in an article here: http://www.railsrocket.com/migrating-to-rails-20 -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 14, 4:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 14 Jan 2008, at 11:01, Daniel Waite wrote: > > > > > > > Praveen Jayarajan wrote: > >> Hi > > >> I am on Rails 1.2.6, but want to get my app running without warning''s > >> so i can move to 2.0.2. > > >> I''m currently getting the folowing warning: > > >> "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > >> avatar insead)" > > > That''s a pretty odd deprecation notice. There''s no "avatar" methods in > > Rails. Perhaps you have deprecated code inside your has_avatar? > > method? > > Could you post the contents of that method? > > Not really: if you have an association you used to get a has_foo? > method. Rails is telling you that has_foo? is going away and that you > should just test whether foo is nil or not. > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 14, 8:50 am, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> Hi > > I am on Rails 1.2.6, but want to get my app running without warning''s > so i can move to 2.0.2. > > I''m currently getting the folowing warning: > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > avatar insead)" > > This is my view code: > > <% if @user.has_avatar? %> > > <p>You already have an Avatar!</p> > > <% else %> > > <h2>Upload Avatar:</h2> > <%= error_messages_for :avatar %> > > <% form_for(:avatar, :url => user_avatars_path, > :html => { :multipart => true }) do |f| -%> > <p> > Select File: > <%= f.file_field :uploaded_data %> > </p> > <p> > <%= submit_tag ''Add Avatar'' %> > </p> > <% end -%> > > <% end %> > > I am not sure how to modify the code correctly. > > Any help appreciated... > > PJ.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 14, 4:01 pm, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Praveen Jayarajan wrote: > > Hi > > > I am on Rails 1.2.6, but want to get my app running without warning''s > > so i can move to 2.0.2. > > > I''m currently getting the folowing warning: > > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > > avatar insead)" > > That''s a pretty odd deprecation notice. There''s no "avatar" methods in > Rails. Perhaps you have deprecated code inside your has_avatar? method? > Could you post the contents of that method? > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 14, 4:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 14 Jan 2008, at 11:01, Daniel Waite wrote: > > > > > > > Praveen Jayarajan wrote: > >> Hi > > >> I am on Rails 1.2.6, but want to get my app running without warning''s > >> so i can move to 2.0.2. > > >> I''m currently getting the folowing warning: > > >> "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > >> avatar insead)" > > > That''s a pretty odd deprecation notice. There''s no "avatar" methods in > > Rails. Perhaps you have deprecated code inside your has_avatar? > > method? > > Could you post the contents of that method? > > Not really: if you have an association you used to get a has_foo? > method. Rails is telling you that has_foo? is going away and that you > should just test whether foo is nil or not. > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 15, 12:24 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> Thank you very much Frederick :) > > PJ. > > On Jan 14, 10:45 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On 14 Jan 2008, at 11:32, PJAY79 wrote: > > > > and, how do i fix this, in newbie terms...?! > > > You need to do exactly what the deprecation message says: don''t use > > has_avatar? > > > <% if @user.has_avatar? %> > > ... > > > becomes > > > <% if @user.avatar %> > > > > Pj. > > > > On Jan 14, 10:30 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > >> I established the relationship between the User and Avatar models as > > >> follow: > > > >> User > > >> has_one :avatar > > > >> Avatar > > >> belongs_to :user > > > >> That was it really...is it something to do with this...? > > > >> PJ. > > > >> On Jan 14, 10:01 pm, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > >> wrote: > > > >>> Praveen Jayarajan wrote: > > >>>> Hi > > > >>>> I am on Rails 1.2.6, but want to get my app running without > > >>>> warning''s > > >>>> so i can move to 2.0.2. > > > >>>> I''m currently getting the folowing warning: > > > >>>> "has_avatar? is deprecated and will be removed from Rails 2.0 > > >>>> (use ! > > >>>> avatar insead)" > > > >>> That''s a pretty odd deprecation notice. There''s no "avatar" > > >>> methods in > > >>> Rails. Perhaps you have deprecated code inside your has_avatar? > > >>> method? > > >>> Could you post the contents of that method? > > >>> -- > > >>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Oi want to full coding in on or more project what about i have lot of things in ruby on rails place help me --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 14, 8:54 am, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you copy and paste the exact error please with any backtrace > > On Jan 14, 2008 2:20 PM, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > > Hi > > > I am on Rails 1.2.6, but want to get my app running without warning''s > > so i can move to 2.0.2. > > > I''m currently getting the folowing warning: > > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > > avatar insead)" > > > This is my view code: > > > <% if @user.has_avatar? %> > > > <p>You already have an Avatar!</p> > > > <% else %> > > > <h2>Upload Avatar:</h2> > > <%= error_messages_for :avatar %> > > > <% form_for(:avatar, :url => user_avatars_path, > > :html => { :multipart => true }) do |f| -%> > > <p> > > Select File: > > <%= f.file_field :uploaded_data %> > > </p> > > <p> > > <%= submit_tag ''Add Avatar'' %> > > </p> > > <% end -%> > > > <% end %> > > > I am not sure how to modify the code correctly. > > > Any help appreciated... > > > PJ. > > -- > Ryan Bigghttp://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 14, 3:18 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> Hi Ryan, this is the output i get from the console, it''s not really an > error, everything actually works, i just want it to work without > getting the deprecated warning! > > Processing AvatarsController#new (for 127.0.0.1 at 2008-01-14 > 21:13:37) [GET] > Session ID: e78fd9233bca38db1b5474e1aa067236 > Parameters: {"action"=>"new", "controller"=>"avatars", > "user_id"=>"1"} > [4;36;1mAvatar Columns (0.017000) [0m [0;1mSHOW FIELDS FROM > avatars [0m > [4;35;1mUser Columns (0.009000) [0m [0mSHOW FIELDS FROM > users [0m > [4;36;1mUser Load (0.005000) [0m [0;1mSELECT * FROM users WHERE > (users.`id` = 1) LIMIT 1 [0m > [4;35;1mUser Load (0.000000) [0m [0mSELECT * FROM users WHERE > (users.`id` = 1) [0m > Rendering within layouts/cool > Rendering avatars/new > DEPRECATION WARNING: has_avatar? is deprecated and will be removed > from Rails 2.0 (use !avatar insead) Seehttp://www.rubyonrails.org/deprecation > for details. (called from _run_rhtml_47app47views47avatars47new46rhtml > at C:/InstantRails/rails_apps/socialnewsone/app/views/avatars/ > new.rhtml:1) > [4;36;1mAvatar Load (0.001000) [0m [0;1mSELECT * FROM avatars > WHERE (avatars.user_id = 1) LIMIT 1 [0m > [4;35;1mRole Columns (0.015000) [0m [0mSHOW FIELDS FROM > roles [0m > [4;36;1mRole Load (0.001000) [0m [0;1mSELECT * FROM roles INNER > JOIN roles_users ON roles.id = roles_users.role_id WHERE > (roles_users.user_id = 1 ) AND (roles.`name` = ''Admin'') LIMIT 1 [0m > Completed in 0.44800 (2 reqs/sec) | Rendering: 0.10700 (23%) | DB: > 0.04800 (10%) | 200 OK [http://localhost/users/1/avatars/new] > > Thanks, > > PJ. > > On Jan 14, 2:54 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Can you copy and paste the exact error please with any backtrace > > > On Jan 14, 2008 2:20 PM, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > Hi > > > > I am on Rails 1.2.6, but want to get my app running without warning''s > > > so i can move to 2.0.2. > > > > I''m currently getting the folowing warning: > > > > "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > > > avatar insead)" > > > > This is my view code: > > > > <% if @user.has_avatar? %> > > > > <p>You already have an Avatar!</p> > > > > <% else %> > > > > <h2>Upload Avatar:</h2> > > > <%= error_messages_for :avatar %> > > > > <% form_for(:avatar, :url => user_avatars_path, > > > :html => { :multipart => true }) do |f| -%> > > > <p> > > > Select File: > > > <%= f.file_field :uploaded_data %> > > > </p> > > > <p> > > > <%= submit_tag ''Add Avatar'' %> > > > </p> > > > <% end -%> > > > > <% end %> > > > > I am not sure how to modify the code correctly. > > > > Any help appreciated... > > > > PJ. > > > -- > > Ryan Bigghttp://www.frozenplague.net > > Feel free to add me to MSN and/or GTalk as this email.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want to full coding in on or more project what about i have lot of things in ruby on rails place help me On Jan 14, 4:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 14 Jan 2008, at 11:01, Daniel Waite wrote: > > > > > > > Praveen Jayarajan wrote: > >> Hi > > >> I am on Rails 1.2.6, but want to get my app running without warning''s > >> so i can move to 2.0.2. > > >> I''m currently getting the folowing warning: > > >> "has_avatar? is deprecated and will be removed from Rails 2.0 (use ! > >> avatar insead)" > > > That''s a pretty odd deprecation notice. There''s no "avatar" methods in > > Rails. Perhaps you have deprecated code inside your has_avatar? > > method? > > Could you post the contents of that method? > > Not really: if you have an association you used to get a has_foo? > method. Rails is telling you that has_foo? is going away and that you > should just test whether foo is nil or not. > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---