Thanks michael. the link helps to understand .reject. thanks again
To get a clear pic, is the .all here truely a syntax error or typo or
is it correct?
self.questions.reject{|q| q.nil?}.all
can anyone clarify.
- thanks,
radha.
Michael Pavling wrote:
On 9 July 2010 03:08, RailsFan Radha li
wrote:
On 9 July 2010 03:35, RailsFan Radha li...@ruby-forum.com wrote:
What is this named_scope. You have provided a very good example, but
still..
Try googling for named_scope. It will provide many useful links.
Did you not think of that yourself? Google is generally much quicker
than
Excellent Ulises.
Thanks for this listing.
I think this will be helpful to everyone.
Ulises Ramirez-Roche wrote:
The .gitignore file should be created in the root directory of your
rails
project. It tells git which files to ignore when looking at files to
commit,
for whatever reason. So
I come from a db world.
Can someone interpret this please, self.questions.reject{|q|
q.nil?}.all
I'm overwhelmed by the syntax in the second line,
self.questions.reject{|q| q.nil?}.all
def needed_questions
self.questions.reject{|q| q.nil?}.all
end
something like that.
i can somewhat
is this named_scope. You have provided a very good example, but
still..
I'm sure all gurus are aware of it, i see it recommended by several ppl.
thanks in advance.
radha
Matt Jones wrote:
On Jun 28, 10:36�pm, RailsFan Radha li...@ruby-forum.com wrote:
Active/inactive are set via status column in category
on the road to
developing two different rails apps in my local machine)
- thanks,
radha.
Robert Walker wrote:
RailsFan Radha wrote:
Env: In VirtualBox / Ubuntu Lucid / current stable version of Ruby on
Rails / Apache2 / Passenger
I wouldn't consider this question on-topic for this forum
I have this apache2/passenger / rails stable version stack running in
ubuntu.
Do u think i could change to mongrel_rails now ?
Michael Pavling wrote:
On 2 July 2010 21:42, RailsFan Radha li...@ruby-forum.com wrote:
yes, this is purely for local development purposes only.
Of course, when I
Update: I have only couple of sample rails apps running in this stack.
How easy/tough it is to switch from apache2/passenger to mongrel rails?
thanks,
radha
RailsFan Radha wrote:
I have this apache2/passenger / rails stable version stack running in
ubuntu.
Do u think i could change
.gitignore seems to be really cool.
but where is this? what is the path for this file .gitignore?
should this be created manually or is it present as part of git install?
I have git installed and couldn't find this file in
/home/myuser/myrailsapp/.git
-thanks
Jeremy wrote:
Just don't check
Hopefully your answer is in this thread.
http://forums.aptana.com/viewtopic.php?f=20t=7563p=27407hilit=libmysql.dll#p27407
one quick q:
did u install mysql after installing ror ?
-thanks
Dave Digital wrote:
I'm able to log in to MySQL and CRUD databases easily with PHPMyAdmin.
WAMP on
)
- restart MySQL server
src:
http://forums.aptana.com/viewtopic.php?f=20t=7563p=27407hilit=libmysql.dll#p27407
RailsFan Radha wrote:
Hopefully your answer is in this thread.
http://forums.aptana.com/viewtopic.php?f=20t=7563p=27407hilit=libmysql.dll#p27407
one quick q:
did u install mysql after
looks like the link didn't get thru..
here it is
http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll
RailsFan Radha wrote:
Update to the post:
Since the error says cannot find mysql client, follow these...
- download older MySQL client library
Colin Law wrote:
On 29 June 2010 03:19, RailsFan Radha li...@ruby-forum.com wrote:
� def list
�def self.find_active_categories
� � �find_by_sql(SELECT * from category
� � � � � where status = 'A')
� � �order by category_id )
�end
Don't use find_by_sql unless absolutely necessary
to view all categories?
thanks,
radha
RailsFan Radha wrote:
Colin Law wrote:
On 29 June 2010 03:19, RailsFan Radha li...@ruby-forum.com wrote:
� def list
�def self.find_active_categories
� � �find_by_sql(SELECT * from category
� � � � � where status = 'A')
� � �order by category_id
If anyone has read the book,
Sitepoint Simply Rails 2 book.
then...
here is my mind breaking q:
Page 331
-
Join Model Relationship:
He has User Model, Story Model and Votes Model in the sample scenario
which he is walking through in this book.
User can write many stories. So, User
thanks Marnen. this is exactly what i as looking for.
Your answer is informative and it explains why i should avoid writing
sqls in it.
thanks again.
-radha.
Marnen Laibow-Koser wrote:
RailsFan Radha wrote:
[...]
What is the bext practice in this case? (Yes, I always want to show
I just read this from the Simply Rails 2 book
model.new_record?
If it is not yet saved, will return true.
If saved, will return false.
Excerpt from this book:
From the Rails console, let’s create this Story class, and an instance
of the class called story, by entering these commands:
class
i'm trying to see if any would return false in your case, as the record
already exists for update.
stumbled upon this:
https://rails.lighthouseapp.com/projects/8994/tickets/1219-new_record-not-set-when-using-joins
let me know if there is any clue here?
(assert ?)
badnaam wrote:
Well so
You could either use the find_by_sql method or the :joins method. (As
someone has stated earlier that avoid find_by_sql for performance and
maintanence reasons)
sample sql to put in find_by_sql in your model
select question_id from responses r1
where not exists
(select question_id from
Env: In VirtualBox / Ubuntu Lucid / current stable version of Ruby on
Rails / Apache2 / Passenger
I have one app called firstapp hosted in my localhost
I think i added one entry to apache2.conf file to view this app from the
browser.
So, now i can access this from the browser 127.0.0.1:3000
Ofcourse, my firstapp and secondapp (both) are ruby on rails apps.
--
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-t...@googlegroups.com.
To
ssmithstone wrote:
change
!-- %= collection_select(:book,:subject_id,@subjects,:id,:name) %/
p
--
to %#= collection_select(:book,:subject_id,@subjects,:id,:name) %
thanks for all . thanks rajeev and hassan and michael.
thanks MicahelPavling, santosh, axelsef and ssmithstone.
special
I have a table called category and i want to show only the records where
status = A in my list.erb
currently, my list.erb shows all records from category table.
but, i would like to show only the records where status = 'A'
for example:
select * frm category where status = 'A'
the idea behind
RailsFan Radha wrote:
I have a table called category and i want to show only the records where
status = A in my list.erb
currently, my list.erb shows all records from category table.
but, i would like to show only the records where status = 'A'
for example:
select * frm category where
Does this mean, that always create a method and call that in the
controller?
Even for find(:all) ?
Is this the best practice?
- thanks,
radha
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
I would like to put this in some sort of version control for source
control as well as for easy deployment when i am ready for hosting.
So, please let me know, which is the post popular one git or sub
version?
most probably, i will be hosting in dreamhost.
If it is git, then what are the steps
This is show action in my category controller.
# Show ---
def show
# @category=Category.find(params[:category_id])
@category=Category.find(params[:category_id])
end
show action - restrict manual url change from user to view the
inactive records.
Active/inactive are set via
Jason Michael wrote:
there are git irc channels and mailing lists and books and web sites
and tutorials. This is a ruby on rails resource.
my new app is in ruby on rails.
-thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google
I should have removed the quoted text in the previous posts too. Just
realized it.
--
I posted this last night. somehow , i don't see it here.
so resposting this fourth update, which is purely for delete action
and this completed CRUD pages setup.
Fourth update to this
Ugis Ozols wrote:
Can you post categories controller new action content?
here is this:
though the erb is called as new.erb. the action in the controller is
named as create
def create
@category = Category.new(params[:category])
if @category.save
redirect_to :action =
here is the full content of category_controller.rb
--
class CategoryController ApplicationController
def index
# List all categories
list
render:action='list'
end
#--- List--
def list
#
Just thought of giving a bit moe info:
So, i added these two lines back into new.erb and reproduced this error.
here is the exact error message:
---
NoMethodError in Category#new
Showing app/views/category/new.erb where line #14 raised:
You
Hi Murali,
This is excatly what i want!
(Looks like my trip to tirupati got answered)
Murali Tirupati wrote:
Hi Radha,
As per the details given by you, you want to run the application with
out using the database migrations and Rake command, provided by the
ROR.
Yes!
You have your own
ruby script/server
If you have data or you do not want to delete them put the new fields in
table which you want to create and then You have to define other fields
in
in you MVC separately that brings a lot of pain for you
On Fri, Jun 25, 2010 at 11:08 PM, RailsFan Radha
li...@ruby
googled doc)
given this scenario, if this is an existing db, how could we create the
CRUD pages for this without doing migration.
thanks
radha
Hassan Schroeder wrote:
On Sat, Jun 26, 2010 at 10:35 AM, RailsFan Radha li...@ruby-forum.com
wrote:
�I have just got a simple db and has been
:
Hi Radha,
My id is sumud...@gmail.com, you can send me the desired requirements, I
will guide you how can you achieve this.
On Sat, Jun 26, 2010 at 11:05 PM, RailsFan Radha
li...@ruby-forum.comwrote:
As per the details given by you, you want to run the application with
Thanks a ton
Hassan Schroeder wrote:
On Sat, Jun 26, 2010 at 11:56 AM, RailsFan Radha li...@ruby-forum.com
wrote:
given this scenario, if this is an existing db, how could we create the
CRUD pages for this without doing migration.
There's an active_scaffold plugin that (I believe) replicates the old
RailsFan Radha wrote:
Hassan Schroeder wrote:
On Sat, Jun 26, 2010 at 11:56 AM, RailsFan Radha li...@ruby-forum.com
wrote:
given this scenario, if this is an existing db, how could we create the
CRUD pages for this without doing migration.
There's an active_scaffold plugin that (I
app/views/category/new.erb
In this file , i have two line like this
!-- plabel for=book_subjectSubject/label: --
!-- %= collection_select(:book,:subject_id,@subjects,:id,:name) %/p
--
But, if these two lines are present , i get an error saying
you have an unexpected nil error
RailsFan Radha wrote:
RailsFan Radha wrote:
Hassan Schroeder wrote:
On Sat, Jun 26, 2010 at 11:56 AM, RailsFan Radha li...@ruby-forum.com
wrote:
given this scenario, if this is an existing db, how could we create the
CRUD pages for this without doing migration.
There's
RailsFan Radha wrote:
RailsFan Radha wrote:
RailsFan Radha wrote:
Hassan Schroeder wrote:
On Sat, Jun 26, 2010 at 11:56 AM, RailsFan Radha li...@ruby-forum.com
wrote:
given this scenario, if this is an existing db, how could we create the
CRUD pages for this without doing migration
kannav rajeev wrote:
Thanks for helping.. here is my comments.
hey radha please explain what you need actually if you trying to making
a
rough apps write down the table field here migrattion tell to create or you
i am not sure of what you mean by write down the table field here.
do u mean
and username and
password for accessing the database were discussed in database.yml not
in
routes.rb
*
On Fri, Jun 25, 2010 at 6:06 PM, RailsFan Radha
li...@ruby-forum.comwrote:
do u mean in the scaffold command or write here?
user_modified varchar(45)
2) datatype specification
43 matches
Mail list logo