On Thu, Jul 14, 2011 at 4:49 PM, Michael Pavling wrote:
> On 14 July 2011 21:24, joanne ta wrote:
>
>> Hang on... this is breaking when you're running tests? Have you raked the
>>> DB changes into your test DB (I'm assuming that the dbconsole is showing you
>&g
On Thu, Jul 14, 2011 at 4:21 PM, Michael Pavling wrote:
> On 14 July 2011 21:14, joanne ta wrote:
>
>> me too.. i am so curious what is happened when name_id is in DB
>> but it keeps saying no column :(
>>
>>
> Hang on... this is breaking when you're
On Thu, Jul 14, 2011 at 4:10 PM, Michael Pavling wrote:
> On 14 July 2011 20:46, joanne ta wrote:
>>
>> I am using commad " rails dbconsole " to get to the db
>> and plus. I use the sqlite3 manager from firefox cho check too
>>
>
> Well something
On Thu, Jul 14, 2011 at 3:41 PM, Michael Pavling wrote:
> On 14 July 2011 20:37, joanne ta wrote:
>
>> I am using the rails dbconsole to check the field in DB
>>
>>>
> Out of curiosity, *which* rails dbconsole are you using? What command do
> you execute to ge
On Thu, Jul 14, 2011 at 3:32 PM, Michael Pavling wrote:
> On 14 July 2011 20:12, joanne ta wrote:
>
>>
>> Since you took the advice to change the foreign key from "name" to
>> "name_id", you need to change the DB field to match. Alter your mig
On Thu, Jul 14, 2011 at 3:04 PM, Michael Pavling wrote:
> On 14 July 2011 19:55, joanne ta wrote:
>
>> On Thu, Jul 14, 2011 at 2:40 PM, Michael Pavling wrote:
>>
>>> Have you read the error?
>>>
>>> Error:
>>>> SQLException: table
On Thu, Jul 14, 2011 at 2:40 PM, Michael Pavling wrote:
> On 14 July 2011 17:26, joanne ta wrote:
>
>> i changed it
>> now it gives me an error
>>
>
> Have you read the error?
>
> Error:
>> SQLException: table languages has no column named name_id
>&
i changed it
now it gives me an error
Error:
test_validates_length_of_name(UserTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: table languages has
no column named name_id: INSERT INTO "languages" ("name_english", "name_id",
"created_at", "updated_at", "id") VALUES ('english', 1, '2011
On Thu, Jul 14, 2011 at 12:10 PM, Michael Pavling wrote:
> On 14 July 2011 16:47, joanne ta wrote:
> > in language model
> > belongs_to :name_id, :class_name => "Phrase", :foreign_key => "name_id"
>
> Why would you change the association na
On Thu, Jul 14, 2011 at 11:13 AM, Michael Pavling wrote:
> On 14 July 2011 16:03, joanne ta wrote:
> > On Thu, Jul 14, 2011 at 10:41 AM, Michael Pavling
> wrote:
> >> In Language, you have "belongs_to :name" (which is really Phrase), and
> >> belongs_t
On Thu, Jul 14, 2011 at 10:41 AM, Michael Pavling wrote:
> On 14 July 2011 15:33, joanne ta wrote:
> >> On 14 July 2011 15:12, joanne ta wrote:
> >> >> > class Language < ActiveRecord::Base
> >> >> > belongs_to :name, :class_name => &
On Thu, Jul 14, 2011 at 10:18 AM, Michael Pavling wrote:
> On 14 July 2011 15:12, joanne ta wrote:
> >> > class Language < ActiveRecord::Base
> >> > belongs_to :name, :class_name => "Phrase", :foreign_key => "name"
> &g
On Thu, Jul 14, 2011 at 10:01 AM, Michael Pavling wrote:
> On 14 July 2011 14:56, joanne ta wrote:
> > It does work at all. it just keeps giving me the same warning ..
> > ~language model
> > class Language < ActiveRecord::Base
> > belongs_to :name, :class_
On Wed, Jul 13, 2011 at 4:25 PM, Colin Law wrote:
> On 13 July 2011 14:29, joanne ta wrote:
> >
> >
> > On Tue, Jul 12, 2011 at 3:01 PM, Tom wrote:
> >>
> >> model language.rb
> >> class Language < ActiveRecord::Base
> >> belong
On Tue, Jul 12, 2011 at 3:01 PM, Tom wrote:
> model language.rb
> class Language < ActiveRecord::Base
> belongs_to :phraes, :class_name => "Phrase", :foreign_key => "name"
> end
>
I did fix the spelling already
belongs_to :phrase, :class_name => "Phrase", :foreign_key => "name"
>
> Id phrase
On Fri, Jul 8, 2011 at 4:28 PM, Colin Law wrote:
> On 8 July 2011 21:19, Yennie wrote:
> > Hi everyone,
> >
> > I am testing the validation of association of the model but i can a
> > error.. plzz help
> >
> >
> > error
> > /usr/local/lib/ruby/gems/1.9.1/gems/shoulda-2.11.3/lib/shoulda/
> > acti
do you have other way to validate presence with message
On Thu, Jul 7, 2011 at 12:39 PM, thiagocifani wrote:
> Hey dude,
>
> I think the most simplist thing to do here could be use the rails helper!
>
> validates_associated :pages, :library
>
>
> shoulda should have some helper to verify the exi
t; sudo gem install rake -v=0.8.7
>
>
> Chirag
> http://sumeruonrails.com
>
>
>
> On Tue, Jul 5, 2011 at 10:18 AM, joanne ta wrote:
>
>>
>>
>> On Tue, Jul 5, 2011 at 12:45 AM, Chirag Singhal > > wrote:
>>
>>> Try using 'bundle ex
bygems_integration.rb:197:in
`block in replace_bin_path': can't find executable rake (Gem::Exception)
from /usr/local/bin/rake:19:in `'"
>
>
> Chirag
> http://sumeruonrails.com
>
>
>
> On Tue, Jul 5, 2011 at 10:12 AM, joanne ta wrote:
>
>>
>&g
On Tue, Jul 5, 2011 at 12:38 AM, joanne ta wrote:
> I did not have any test on my project. i just use bundle update rake
> and then, it gives me that error..
>
and I have 2 version of rake (0.9.2 / 0.8.7)
do you know anyway that i can switch back to 0.8.7
>
>
> plz help
>
I did not have any test on my project. i just use bundle update rake
and then, it gives me that error..
plz help
thanks
On Tue, Jul 5, 2011 at 12:24 AM, Chirag Singhal wrote:
> Please include your test that is failing here.
> Most probably the issue is that you are expecting a object somewhere
thanks you so much..
Joanne
On Tue, Jun 21, 2011 at 1:29 PM, Chirag Singhal wrote:
> Getting pretty late here, heading to bed. We can work on a cleaner solution
> tomorrow or others on the forum can help.
> For now, this quick and dirty solution should work:
>
> # In your view
> <% @users.each do
On Tue, Jun 21, 2011 at 12:52 PM, Chirag Singhal
wrote:
> Ok, some more questions:
> 1. So, you want to display an image of the culture associated with the
> user, right?
>
yes
> 2. How are you uploading pictures to your database?
>
right now, i just using the sqlite manager to upload the blob.
Ok, that's clear now.
>
> Do you use pastie (http://pastie.org/) or gist (https://gist.github.com/)?
> If yes, can you paste following on any of them and reply with link?
> No, I am not using that..
>
> #models
> User
>
id
name
address
culture_id
Picture
>
id
image(binary)
phrase_id
culture_id
On Tue, Jun 21, 2011 at 12:31 PM, joanne ta wrote:
>
> Ok, that's clear now.
>>
>> Do you use pastie (http://pastie.org/) or gist (https://gist.github.com/
>> )?
>> If yes, can you paste following on any of them and reply with link?
>> No, I am using t
end
def show
@user= User.find_by_id(params[:id])
end
end
>
> #views
> users/index
>
<%= image_tag url_for(:controller => "/patients", :action => "index"),
:width => "25px", :height => "25px"%>
>
> On Tue,
er and display
it on the screen.
can u help me... thanks :X so much much..
Joanne
>
>
> On Tue, Jun 21, 2011 at 9:22 PM, joanne ta wrote:
>
>>
>> Not sure why it errors out now.
>>> Do you get the same error is it a different error this time?
>>>
eted in 237ms
NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.compact!):
app/controllers/users_controller.rb:27:in `block in index'
app/controllers/users_controller.rb:25:in `each
Jun 21, 2011 at 8:35 PM, joanne ta wrote:
>
>>
>>
>> Can you paste what you have in your index method?
>>> You should not be getting this error because we have already defined @pic
>>> as an empty array.
>>>
>>>
>>
>>
>>>
>
> >> def index
> >> @users= User.all
> >> @pic= []
>
> You would probably have fewer problems if you observed the Rails
> naming conventions; e.g.
>
> @pictures = [] # plural
>
> @users.each do |user|
> @pictures << Picture.where(:phrase_id => :route , :culture_id
> =>user.culture_i
e(:phrase_id => :route , :culture_id =>
> p.culture_id).first
>
> end
>
> @pic.compact!
> send_data @pic.image, :type => 'image/png', :disposition => 'inline'
>
> end
>
> On Tue, Jun 21, 2011 at 8:10 PM, joanne ta wrote:
>
>
ou didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.compact!):
app/controllers/patients_controller.rb:29:in `index'
what is mean? cuz i want to display picture on the browser too...
please help... thank you very much
Joanne
&g
it does not work, it is complaining other error
NoMethodError (undefined method `image' for [nil]:Array):
app/controllers/patients_controller.rb:27:in `block in index'
app/controllers/patients_controller.rb:25:in `each'
app/controllers/patients_controller.rb:25:in `index'
On Tue, Jun 21, 2
> My controller:
>
>
> def index
>@users= User.all
>
> @users.each do |p|
> @pic= Picture.where(:phrase_id => :route , :culture_id =>
> p.culture_id).first
> send_data @pic.image, :type => 'image/gif', :disposition => 'inline'
> end
> end
>
> in View
>
>
> <%= image_tag u
My controller:
def index
@users= User.all
@users.each do |p|
@pic= Picture.where(:phrase_id => :route , :culture_id =>
p.culture_id).first
send_data @pic.image, :type => 'image/gif', :disposition => 'inline'
end
end
in View
<%= image_tag url_for(:controller => "/users
the error is undefined method `image' for nil:NilClass
On Mon, Jun 20, 2011 at 2:42 PM, Colin Law wrote:
> On 20 June 2011 17:53, joanne ta wrote:
> > I have other undefined method when i combine the code above together
> >
> > <%@users = User.
auses undefined method image
please give me advices thank you so much
Joanne
On Mon, Jun 20, 2011 at 12:48 PM, joanne ta wrote:
> thanks
>
> On Mon, Jun 20, 2011 at 12:38 PM, Everaldo Gomes > wrote:
>
>> Hi!
>>
>> The method User.all returns an Array of
thanks
On Mon, Jun 20, 2011 at 12:38 PM, Everaldo Gomes
wrote:
> Hi!
>
> The method User.all returns an Array of users, not a single user.
>
> I think you have to iterate over the array, using each.
>
> @users.each { |u| u.name }
>
> Everaldo
>
>
> On Mon, Jun 20, 2011 at 1:33 PM, Yennie wrote:
you should turn off all the server that you run.
and run "rails server"' again ... if you have 2 server on check it
maybe one of them is http://0.0.0.0:3000 and other is
http://0.0.0.0:3001<http://0.0.0.0:3000/>
Joanne
On Wed, Jun 15, 2011 at 12:32 PM, joanne ta wrote:
&
1st, what do you use to run the server? netbeans or in ternimal
2011/6/15 Iván Hernández
> On 06/15/2011 05:14 PM, joanne ta wrote:
>
> I think you turn more than one server is on..
>
>
> On Wed, Jun 15, 2011 at 10:37 AM, Distriker <
> ivanhcelrinconelme...@gmail.
I think you turn more than one server is on..
On Wed, Jun 15, 2011 at 10:37 AM, Distriker wrote:
> Hi, I'm trying initialize my local rails server but I haven't can,
> because when I write "rails server", show me this message:
>
>
> => Booting WEBrick
> => Rails 3.0.3 application starting in de
I run those code in terminal
user_instance = User.find(1)
=> it shows me all the data in the User table
and then i run
Picture.where(:album_id => :album, :culture_id =>
user_instance.culture_id).first
=>nil
On Tue, Jun 14, 2011 at 2:15 PM, Tim Shaffer wrote:
> I cannot explain it. You're
i did try the code from above on rails console. it is return nil...
so can you explain it please
On Tue, Jun 14, 2011 at 12:01 PM, Tim Shaffer wrote:
> I'm not sure what you're trying to say.
>
> When you use "culture_id" in the where clause, it needs to have a value.
> This value can come from
user_instance = User.find(1)
@pic = Picture.where(:album_id => :album, :culture_id =>
user_instance.culture_id).
first
ya, it work but it return nil.. and i cannot take value from Picture model
it causes me undefined method image when i call @pic.image
On Tue, Jun 14, 2011 at 11:19 AM, Tim Sh
I have culture_id in Picture Model as well
On Tue, Jun 14, 2011 at 10:33 AM, Noel wrote:
> I think the problem is that you dont have :culture_id => in the
> Picture model. Is that right?
>
> On Tue, Jun 14, 2011 at 7:19 AM, Yennie wrote:
> >
> > Hi all,
> >
> > I have an error which said undef
Sorry, I mean get the list of user id ...
cuz my query depends on user.id .. so i want to have a list which is array
to go through
the album..
On Mon, Jun 13, 2011 at 1:53 PM, Michael Pavling wrote:
> On 13 June 2011 18:33, Yennie wrote:
> > @id = User.find(:all, :select => 'users.id')
>
Hi,, do you have any other options for me.. cuz i really have to do in this
way
Thanks
On Sat, Jun 11, 2011 at 10:07 PM, Hassan Schroeder <
hassan.schroe...@gmail.com> wrote:
> On Sat, Jun 11, 2011 at 6:02 PM, joanne wrote:
>
> > I have taken a picture(BLOB) in the DB (sqite3),
> > I have a pro
no no no lol
On Sat, Jun 11, 2011 at 10:05 PM, Michael Pavling wrote:
> On 12/06/2011, joanne wrote:
> > I have taken a picture(BLOB) in the DB (sqite3),
> > I have a problem to display picture on the screen.
> > Can anyone help me and give me some advices please
>
> Amritpal? Is that you?
>
>
in view:
<%=@patient.image %>
in controller
@user=Picture.all(
:joins => :culture,
:conditions => (Phrase.joins(:description))).first
and it shows this on the screen,
GIF89a � ��ýf�* zd:2eZJ���R �̙ݼ�iZA:0��ޙ��B
���|||^Rc ���
i am have any error about the code.. but i cannot show/ display picture on
the screen
On Fri, Jun 10, 2011 at 10:50 AM, Michael Pavling wrote:
> On 10 June 2011 15:47, joanne ta wrote:
> > and i have other question..
>
> If you have another question, please start another threa
Thanks all. :D..
and i have other question.. when i take the image file (BLOD).. i cannot
display it .. do you have any idea...
Please give me some advice.. thanks \
On Fri, Jun 10, 2011 at 12:19 AM, 3dd13 wrote:
> you exectued people.all.first
> so the @user only has one picture object
I did copy and paste those code. anyway, I did found the way to solve the
problem . thanks all :P
On Mon, May 30, 2011 at 12:17 PM, Colin Law wrote:
> On 30 May 2011 17:29, joanne ta wrote:
> > I have no idea about that. However, I am pretty sure that the name of DB
> is
> >
Hi,
I did try it before as well, it still giving me the same error
On Mon, May 30, 2011 at 12:34 PM, Tom Meinlschmidt
wrote:
> > @language = Languages.new
>
> should be @language = Language.new
>
> singular. not plural
>
>
> On May 30, 2011, at 18:29 , joanne ta
I have no idea about that. However, I am pretty sure that the name of DB is
correct
and my controller is like this
class LanguagesController < ApplicationController\
def new
@language = Languages.new
end
end
and it points out the problem on "new"
app/controllers/language_controller.rb:7
54 matches
Mail list logo