Re: [Rails] why I have one more line?

2011-02-16 Thread Mauro
On 15 February 2011 23:59, Lorenzo Brito Morales
lorenzo.br...@gmail.com wrote:
 No hay problema, de casualidad no eres de mexico? jaja yo igual soy

I'm italian, from Sardinia.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Problems working with Legacy database - associations

2011-02-16 Thread Frederick Cheung

On 15 Feb 2011, at 20:26, Mark ander...@mitre.org wrote:

 
 
 In the Rails console:
 
 irb ts = TableSchema.find(:first, :conditions = table_name =
 'ENTITY_INST')
 = [#TableSchema ID: 88E65D47-621C-4DD6-BD6F-B9ABD93437F8,
 TABLE_NAME: ENTITY_INST, DISPLAY_NAME: Entity Instance
 , TYPE: 1, DESCR: All \real things\ - by label, DELETED_FLAG:
 false, CLASS_ID: 085F7B9E-3
 99D-48AD-A7A3-2AD48769F99B]
 
 irb ts.my_objects
 NoMethodError: undefined method `my_objects' for #Array:0x47c5830
 
 irb c = Classification.last
 = #Classification ID: 3E3A8383-8469-4847-8485-C6761B09FD46,
 CLASS_TEXT: UNCLASSIFIED
 
 irb c.my_objects
 = []
 
 
 1. Why is ts.my_objects not defined, but c.my_objects IS (apparently)
 defined?

It looks like you're getting an array containing a single object back, rather 
than that single object. Not sure why. 
 2. c.my_objects should return dozens of MyObject objects.  Why does it
 return none?

Does the SQL generated (check the log file) look right?
 
 - Mark
 
 I'm using Rails 3.0.3
 Ruby 1.8.7
 SQL Server 2008
 Windows XP (sigh)
 
 -- 
 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@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.
 

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Regular expression not working in Rails

2011-02-16 Thread Colin Law
On 16 February 2011 03:41, Rob Biedenharn r...@agileconsultingllc.com wrote:

 On Feb 15, 2011, at 10:12 PM, Keith Raymond wrote:

 I can't figure out why this regexp isn't working in my rails method.
 I've been testing it with the the firefox regular expression tester add
 on and it works there but not in the rails app.

 My expression is:  /\Q[img['\E/
 I'm trying to match: [img['

 irb /\[img\['/ =~ [img['
 = 0

 You need to ecsape the [ characters as they introduce a character set, e.g.,
 [a-z] or [0-9] or even [img] to match any of 'i', 'm', or 'g'.

It have noticed previously that some regexp engines are clever enough
to work out that a mismatched [ does not need to be escaped, which is
likely why it appeared to work in FF.  I would have thought though
that something that purports to be a 'tester' should enforce the rules
rigorously.

Colin

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Begining with RoR, litle questions

2011-02-16 Thread Julien
Hi,

1)Ruby is simple, clean and elegant, you can learn it while learning
rails, it's nearly like speaking english.
2)you can use with Apache (http://www.modrails.com/)
3)i don't know PDO, but there is DB abstraction with Active Record
http://guides.rubyonrails.org/active_record_querying.html, which makes
queries object-oriented, and you can switch from DB1-mysql to DB2-
postgre just by changing your config file and that won't affect your
app.

I've heard Symfony automagically creates admin spaces on new
projects ; in Rails you'll have to make it a bit more by yourself but
with scaffolding it's rather easy.
There are lots of Gems and Plugins to enrich your app with features
you need (authentication, image/file uploading...)

Hope you'll enjoy Rails :)


On 15 fév, 15:48, Norbert Melzer timmel...@googlemail.com wrote:
 Hi!

 I came to Rails because I helped localizing a project from English to
 german. This made me curious about the possibilities that rails offered, so
 I started to learn rails and got the needed ruby knowledge without extra
 costs :-) Learning was some times hard, because I came from C and its
 siblings with strong typing and such, so ruby with its loose rules made me
 stumble very often over errors that would not even be possible with a C type
 language.

 Top posted from android

 Am 14.02.2011 21:50 schrieb Copitux davidmedi...@gmail.com: Hello,

  First, sorry about my english.

  I come from lamp+symfony world, i understand the MVC design and so
  on... my questions...

  1. Should learn ruby 100% before entering the documentation for RoR?
  2. Works with apache as module?
  3. What about DB abstraction? something similar to PDO in php?

  Appreciate a few links in addition to the official.

  In short, a little guidance of where to start

  PD: I'm asking before searching extensively because I prefer opinions
  from people who use it and I think there are not questions too
  complicated to respond quickly.

  --
  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@googlegroups.com.
  To unsubscribe from this group, send email to

 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this 
 group at

 http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Validates_presence_of on alternative fields

2011-02-16 Thread Piotroslav
Well I am using Hobo, which in my case generates form with boolean
fields as checkbox.
Form is rendered from following dryml:
def tag=win-form for=Lead
  form lifecycle=win merge param=default
error-messages param/
input type=hidden name=key
value=this.lifecycle.provided_key if=this.lifecycle.provided_key/

field-list fields=proposal, duration, value, contract_signed,
start_at_risk param/
div param=actions
  submit label=#{ht 'leads.actions.win', :default=['Win']}
param/or-cancel param=cancel/
/div
  /form
/def
Validation I want to use would be placed in Lead model for specified
transition, but if we could do it other way it would be fine too.

To be honest I am not sure how to put javascript inside it (but its
true it would be much easier with js) nor how to switch to radioboxes.
If you know what should I do please give me a hint.

I'll ask similar question on Hobo group.

Best regards,
  Piotr

On 15 Lut, 17:08, Colin Law clan...@googlemail.com wrote:

 Validation is not on form fields but on data about to be saved to the
 database.  Do you have two columns in the table, one for each
 checkbox?  If so, and only one of them should be selected then reduce
 it to a single column.  As far as the form is concerned you may be
 better with a radio box as Amador has suggested.  If you need them to
 be checkboxes you could use javascript to clear one when the other is
 selected.

 Colin

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] 3.0.4 change to chained where methods. Documentation?

2011-02-16 Thread Colin Law
On 16 February 2011 05:42, Mark Kremer m...@without-brains.net wrote:
 It may seem a bit odd with the where method chained twice like that, but the
 query with the OR (Rails 3.0.4) will probably get you the result you want
 whereas the query with the AND (Rails 3.0.3) will return 0 records at all
 times (because the same attribute can't have two values).

I disagree that OR is the result one would want if one were to code
this.  I agree it is apparently a useless query and obviously one
would not code it exactly like this.  If the sql for this is
incorrectly generated however, it is likely that a more subtle, and
useful, query may also be encoded wrongly.  The principle of chained
where is that the first one is performed, then the next is performed
on the results of the first.  At least that is how I understand it.

Consider:
State.where(:abbreviation =  'TX').where(abbreviation =  'NE')
This (correctly in my view) uses AND in the query.
As 3.0.4 stands at the moment the above yields a different result to
State.where(:abbreviation =  'TX').where(:abbreviation =  'NE')
which seems incorrect to me.

I will post on rails-core to see what the response is there.

Colin


 On 15-2-2011 10:07, Colin Law wrote:

 On 14 February 2011 21:03, Jeremyjmcne...@gmail.com  wrote:

 I've noticed a rather insidious 3.0.4 change to the way that chained
 where methods that reference the same attribute are handled.  Does
 anyone know where I can find more information about where/when this
 change came in, and the justification for it?  I haven't been able to
 find a changelog mentioning this modification.

 Essentially, when you chain two where methods together that reference
 the same attribute, the SQL query generated uses an OR on that
 attribute, rather than AND.

 Example:

 Rails 3.0.3
 State.where(:abbreviation =  'TX').where(:abbreviation =  'NE')
 SQL: SELECT `states`.* FROM `states` WHERE (`states`.`abbreviation` =
 'TX') AND (`states`.`abbreviation` = 'NE')

 Rails 3.0.4
 State.where(:abbreviation =  'TX').where(:abbreviation =  'NE')
 SQL: SELECT `states`.* FROM `states` WHERE (`states`.`abbreviation` =
 'TX' OR `states`.`abbreviation` = 'NE')

 I can confirm I see the same issue on 3.0.4 (not tried on 3.0.3).  It
 looks like a bug to me.

 Colin


 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Errno::ENOENT after problemless start

2011-02-16 Thread Kael
Dear Fellow Programmers,

I have a problem, I hope you can help me:
there is a site: sorsveto.hu (actually the problem is there, you can
check it).
Few days ago we set it on production mode.
It runnin on an nginx with 3 thin clasters. Its stand up well without
any problems. Two days later suddenly an error appeared:

Errno::ENOENT
No such file or directory - /ror/sorsveto/sorsveto.hu/www/config/
locales/en.yml
Rails.root: /ror/sorsveto/sorsveto.hu/www

At the moment I can restart the application if I upload a file
restart (without extension). Anyway if I restart the application the
error is still there.
And of course the en.yml file is there.

I don't know why is this happens and even don't know how to solve it.
I've seen some solutions about this error but mostly focused on win7
setups and single gem updates.

I hope you can tell me some usefull handling.

Yours,
Előd, Czakó

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] why destroy doesn't work.

2011-02-16 Thread Mauro
class DistrictsController  ApplicationController
.
.
.
def destroy
   @district = District.find(params[:id])
   @district.destroy

   respond_to do |format|
 format.html { redirect_to(districts_url) }
 format.xml  { head :ok }
   end
 end

% @districts.each do |district| %
 tr
   td%= district.district_number %/td
   td%= district.address %/td

   td%= link_to 'Show', district %/td
   td%= link_to 'Edit', edit_district_path(district) %/td
   td%= link_to 'Destroy', district, :confirm = 'Are you sure?',
:method = :delete %/td
 /tr
% end %

If I click on destroy link it shows me the district.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: why destroy doesn't work.

2011-02-16 Thread Mauro
On 16 February 2011 10:49, Mauro mrsan...@gmail.com wrote:
 class DistrictsController  ApplicationController
 .
 .
 .
 def destroy
   @district = District.find(params[:id])
   @district.destroy

   respond_to do |format|
     format.html { redirect_to(districts_url) }
     format.xml  { head :ok }
   end
  end

 % @districts.each do |district| %
  tr
   td%= district.district_number %/td
   td%= district.address %/td

   td%= link_to 'Show', district %/td
   td%= link_to 'Edit', edit_district_path(district) %/td
   td%= link_to 'Destroy', district, :confirm = 'Are you sure?',
 :method = :delete %/td
  /tr
 % end %

 If I click on destroy link it shows me the district.


Sorry I've missed javascript.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Bypassing ORM for performance, is it worth it ?

2011-02-16 Thread bingo bob
Thanks for yours, I hear your ideas.

I'm not hearing anything massive that I haven't done or need to change. 
I think I'll stay where I am for now and see how I go - updated_at 
column is indexed.

Thanks for the tips re the JSON, I had done a tweak on that in the model 
already by overriding the default to_json method to only include the 
attributes I need to serve.

I figure I'm in reasonable shape, I'm now looking at how to benchmark 
and performance monitor. Got hold of the rawk.rb script yesterday which 
looks helpful..

Anyone know anything that will monitor a production log live and report 
requests/sec?

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] 3.0.4 change to chained where methods. Documentation?

2011-02-16 Thread Colin Law
On 16 February 2011 09:44, Colin Law clan...@googlemail.com wrote:
 On 16 February 2011 05:42, Mark Kremer m...@without-brains.net wrote:
 It may seem a bit odd with the where method chained twice like that, but the
 query with the OR (Rails 3.0.4) will probably get you the result you want
 whereas the query with the AND (Rails 3.0.3) will return 0 records at all
 times (because the same attribute can't have two values).

 I disagree that OR is the result one would want if one were to code
 this.  I agree it is apparently a useless query and obviously one
 would not code it exactly like this.  If the sql for this is
 incorrectly generated however, it is likely that a more subtle, and
 useful, query may also be encoded wrongly.  The principle of chained
 where is that the first one is performed, then the next is performed
 on the results of the first.  At least that is how I understand it.

 Consider:
 State.where(:abbreviation =  'TX').where(abbreviation =  'NE')
 This (correctly in my view) uses AND in the query.
 As 3.0.4 stands at the moment the above yields a different result to
 State.where(:abbreviation =  'TX').where(:abbreviation =  'NE')
 which seems incorrect to me.

 I will post on rails-core to see what the response is there.

I posted to rails-core and apparently it is by design rather than a
bug.  The question seems to have stirred up a bit of a furore however,
see 
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/407f746fd1de6636

Colin

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] [Rails3] Visitor is a reserved word?

2011-02-16 Thread Fernando Perez
I cannot do the following on my freshly created and immaculate app:

$ rails g model Visitor

The name 'Visitor' is either already used in your application or
reserved by Ruby on Rails. Please choose an alternative and run this
generator again.

I checked the rails wiki, but Visitor doesn't appear as a reserved word.
What am I doing wrong?

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Things that framework other than RoR Cannot do?

2011-02-16 Thread gezope
I'm not an expert, and Rails mailing lists is one of the most helpful
I must say.

I use WordPress and Drupal too. Wanted to change because Rails has the
only unpainful way for Test Driven Development. I could not find any
other framework which has such a nice way to do that (except Java with
JUnit and JS but I mean complete webframework.) Or is it exist for
Django?

bests

On febr. 10, 07:54, amritpal pathak amritpalpath...@gmail.com wrote:
 Including druapl,wordpress(Cms) and other frameworks like django what are
 those things in web development that they cannot do but Ruby on Rails can
 do??
 Please clear me this confusion!!
 Thanking you.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Which editor to use

2011-02-16 Thread Arun Srini
I like RedCar very much because it is very similar to TextMate which
is my all time fav editor when using my Mac. But everytime I run it,
seems to suck out all resources and the system becomes very very slow.
I tried seeing the memory usage from the 'top'
and it says redcar uses so much RAM.
I tried UltraEdit(trial version) and Geany, both work very fine.

UltraEdit has the tree view file browser which is very helpful when
working with any framework like RoR,but it is not free. Geany has File
Browser as a plugin, but it breaks many times that I got bored to see
the issue of WHY.
I am trying Komodo Edit now. But if anyone knows an editor that has
tree based file viewer in itself and not as a plugin please let me
know. And yeah, it should be free.

On Feb 16, 12:50 am, Norbert Melzer timmel...@googlemail.com wrote:
 Even if I use redcar after netbeans dropped rails support, I would recommend
 to use vim at least once in a while, it is a powerful and relative easy to
 use tool for the commandline when applying a quick hack via ssh.

 Top posted from android

 Am 15.02.2011 22:42 schrieb ben bfkel...@gmail.com: Use vim. You wont 
 need anything else once you learn vim. It is also
  customizable for what ever you need it to do. Everything else is for
  children.

  On Feb 15, 1:40 am, Mitin Rai mitin...@gmail.com wrote:
  i have just installed ror on ubuntu (trying my hand on ubuntu).
  which editor is good that i can use
  thanks

  --
  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@googlegroups.com.
  To unsubscribe from this group, send email to

 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this 
 group at

 http://groups.google.com/group/rubyonrails-talk?hl=en.









-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Mauro
On 16 February 2011 13:00, Arun Srini arunro...@gmail.com wrote:
 I like RedCar very much because it is very similar to TextMate which
 is my all time fav editor when using my Mac. But everytime I run it,
 seems to suck out all resources and the system becomes very very slow.

Redcar is still young its version is 0.1.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: [Rails3] Visitor is a reserved word?

2011-02-16 Thread Fernando Perez
My bad I just realized that my app is called visitor and Rails3 uses 
this name in various places.

I don't like this new convention, if I want to change the name of my app 
I need to fix it in a few places.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Jatin kumar
My personal choice is gEdit...its simple, and you can add simple things like
syntax highlighting, word completion etc.
I don't like using IDE's like Komodo Edit, Netbeans for Rails...its better
if you type them yourself in the console.
Rest, its a personal choice.

On Wed, Feb 16, 2011 at 6:42 PM, Mauro mrsan...@gmail.com wrote:

 On 16 February 2011 13:00, Arun Srini arunro...@gmail.com wrote:
  I like RedCar very much because it is very similar to TextMate which
  is my all time fav editor when using my Mac. But everytime I run it,
  seems to suck out all resources and the system becomes very very slow.

 Redcar is still young its version is 0.1.

 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Begining with RoR, litle questions

2011-02-16 Thread gezope
Hello Copitux,

0. Never worry about your English, it's fine :)

1. Little Ruby is always helpful, but if you used any other prog lang
like PHP then it won't be hard. The best Rails tutorials already has a
little part about Ruby you need:

http://ruby.railstutorial.org/ruby-on-rails-tutorial-book - it starts
with Heroku + Git + Test-Driven Development. Souds ScArY but give a
try, made it easy for me, it will worth ;)

http://www.pragprog.com/titles/rails4/agile-web-development-with-rails

http://guides.rubyonrails.org/

It's very wise thing to install Rails and gems with RVM :
http://rvm.beginrescueend.com/ prevents problems later.

2. Yes it works with Apache. If you try new tech like Rails also try
other related technology which might be helpful:
Git:  http://git-scm.com/
Github for repo: https://github.com/
Heroku for hosting: http://heroku.com/

3. DB: with Rails it's better with PHP frameworks. Check ActiveRecord
and if you want better solution I think DataMapper will amaze you:
http://datamapper.org/

+1. Rails is fun. Have fun ;)
gezope

On febr. 14, 17:28, Copitux davidmedi...@gmail.com wrote:
 Hello,

 First, sorry about my english.

 I come from lamp+symfony world, i understand the MVC design and so
 on... my questions...

 1. Should learn ruby 100% before entering the documentation for RoR?
 2. Works with apache as module?
 3. What about DB abstraction? something similar to PDO in php?

 Appreciate a few links in addition to the official.

 In short, a little guidance of where to start

 PD: I'm asking before searching extensively because I prefer opinions
 from people who use it and I think there are not questions too
 complicated to respond quickly.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Path and Url

2011-02-16 Thread gezope
Hi there,

With *_url you'll get the full path with protocol and domain name. Use
it for redirect method for example, or when you redirecting for total
different domain.

With *_path you will get the part from your path which is after '/'
without domain and stuff. Use it every other situation I think.

With redirecting _path will also work fine, just later it can cause
problems when you need to refactor your code. And an easy link_to can
be used with _url, but it fills your HTML unnecessary characters,
which also not a good idea.

Check both, see the source of your HTML and you will see easily the
diff.

good luck,
gezope

On febr. 15, 22:05, Rodrigo Alves Vieira rodrig...@gmail.com wrote:
 Hello everyone, what's the real difference between root_url and root_path in
 Rails, for example. Apparently both lead to the same route in the
 application.

 Thanks!

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Hide/Show Div and link_to_remote

2011-02-16 Thread pepe
 Lets ignore the 'editable' form part.  In general how would I hide/
 show a div on a button click for instance?

In addition to what Walter mentioned there is the 'toggle' function:
http://api.prototypejs.org/dom/Element/toggle/

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Path and Url

2011-02-16 Thread Rodrigo Alves Vieira
Thank you guys. I checked it out and it makes total sense. 

Cheers!

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: [Rails3] Visitor is a reserved word?

2011-02-16 Thread Rodrigo Alves Vieira
Rails way to avoid ambiguity.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Hassan Schroeder
On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com wrote:

 ... But if anyone knows an editor that has
 tree based file viewer in itself and not as a plugin please let me
 know. And yeah, it should be free.

I believe it's already been mentioned: jEdit  (http://jedit.org/)

It's free and extremely configurable/extensible.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Path and Url

2011-02-16 Thread Walter Lee Davis
One other thing to look at is using _url whenever you need to cross  
the secure / non-secure bridge (either way). Also, any time you are  
inside JavaScript (Ajax) requests, be sure to use _path, otherwise you  
may trigger a same origin policy error in browsers that care about  
security.


Walter

On Feb 16, 2011, at 8:58 AM, Rodrigo Alves Vieira wrote:


Thank you guys. I checked it out and it makes total sense.

Cheers!

--
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 unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en 
.


--
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Which editor to use

2011-02-16 Thread Van
I like gedit text editor which is a standard accessory with Ubuntu.
No problems in 2 years of constant use.
NetBeans is a slow pig.

Beware of friends (software) that tries to be too friendly,

Van

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Which editor to use

2011-02-16 Thread Felipe Espinoza Castillo
On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
wrote:
 On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com wrote:
  ... But if anyone knows an editor that has
  tree based file viewer in itself and not as a plugin please let me
  know. And yeah, it should be free.

 I believe it's already been mentioned: jEdit  (http://jedit.org/)

 It's free and extremely configurable/extensible.

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 twitter: @hassan

I totally recommend you to use Vim, specially the GUI version,
there is a lot of great plugins that increase the usability and the
power of the editor so much, it's really great

I leave you a link to my github vim repository, there are my
customizations
so it'll be easier for you have a great configuration in Vim

https://github.com/forellana/dotvim

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Solving a problem: keep tracking of an index through controller view

2011-02-16 Thread Felipe Espinoza Castillo
Hi,

I want some help to solve this problem that I have:

I have a form for some controller/model called Expense(s) in the
new_daily method, in that form I have a table with 5 rows, where I
have to put the fields needed to create each of daily expenses that I
could have, but of course, you would have more than 5 expenses in one
day, so I have a link to Add Expense to add a new row to the
expenses table form with the correct fields and internally it must
have a certain id, name structure wich is the same for all rows except
for and index, for example:

expenses[e1][name], expenses[e1][amount], expenses[e1][category]
expenses[e2][name], expenses[e2][amount], expenses[e2][category]

The problem is that I don't know how to keep tracking of that index
for the form, I want to use a controller action add_expense that
calls a add_expense.js.erb to use jquery and rendering a partial
containing that new row, but with the correct index.

If I save the index in the add_expense controller method it gets reset
anytime I try to use the method again, and inside it I've defined like
@n ||= 5
but it's always 5, It doesn't remember the %= @n += 1 % that I use
in the js view

Another option would be use unobstrusive javascript and get that
number in a data-numer attribute in that form table, but then I'm not
able to pass as a parameter to the partial that I want to render.

How would you solve this?

Greetings

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread David Kahn
On Wed, Feb 16, 2011 at 10:14 AM, Felipe Espinoza Castillo 
fespinozac...@gmail.com wrote:

 On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
 wrote:
  On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com wrote:
   ... But if anyone knows an editor that has
   tree based file viewer in itself and not as a plugin please let me
   know. And yeah, it should be free.
 
  I believe it's already been mentioned: jEdit  (http://jedit.org/)
 
  It's free and extremely configurable/extensible.
 
  --
  Hassan Schroeder  hassan.schroe...@gmail.com
  twitter: @hassan

 I totally recommend you to use Vim, specially the GUI version,
 there is a lot of great plugins that increase the usability and the
 power of the editor so much, it's really great


Yeah, I just left TextMate for vim. I almost ditched it after the first day,
but after the second day I won't go back to Textmate. If you do it make sure
you check out FuzzyFinder and NerdTree. Once you can get files open then you
can use the mouse/visual mode until you get more commands down. I am finding
it quite fun to use.


 I leave you a link to my github vim repository, there are my
 customizations
 so it'll be easier for you have a great configuration in Vim

 https://github.com/forellana/dotvim

 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Solving a problem: keep tracking of an index through controller view

2011-02-16 Thread Colin Law
On 16 February 2011 16:06, Felipe Espinoza Castillo
fespinozac...@gmail.com wrote:
 Hi,

 I want some help to solve this problem that I have:

 I have a form for some controller/model called Expense(s) in the
 new_daily method, in that form I have a table with 5 rows, where I
 have to put the fields needed to create each of daily expenses that I
 could have, but of course, you would have more than 5 expenses in one
 day, so I have a link to Add Expense to add a new row to the
 expenses table form with the correct fields and internally it must
 have a certain id, name structure wich is the same for all rows except
 for and index, for example:

Have you seen
http://railscasts.com/episodes/196-nested-model-form-part-1
I suggest you spend an hour working through it and the next episode
(part 2 oddly enough) in order to appreciate what is going on.  I
think it may give you some ideas on the way to go.

Colin



 expenses[e1][name], expenses[e1][amount], expenses[e1][category]
 expenses[e2][name], expenses[e2][amount], expenses[e2][category]

 The problem is that I don't know how to keep tracking of that index
 for the form, I want to use a controller action add_expense that
 calls a add_expense.js.erb to use jquery and rendering a partial
 containing that new row, but with the correct index.

 If I save the index in the add_expense controller method it gets reset
 anytime I try to use the method again, and inside it I've defined like
 @n ||= 5
 but it's always 5, It doesn't remember the %= @n += 1 % that I use
 in the js view

 Another option would be use unobstrusive javascript and get that
 number in a data-numer attribute in that form table, but then I'm not
 able to pass as a parameter to the partial that I want to render.

 How would you solve this?

 Greetings

 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails]

2011-02-16 Thread loganathan sellappa
Hi all,

with following fields

apigroup_name=production-- (single table)
loginid=43
email=t...@test.com

clientapp= ActiveRecord::Base.connection.execute(SELECT
`sdm_users`.`loginid`,`sdm_users`.id,`sdm_users`.`email`,`api_groups`.`name`,`api_groups`.`is_autokey_generate`,`api_groups`.`id`
FROM `sdm_users`,`api_groups` WHERE `sdm_users`.`loginid` ='#{loginid}' 
`sdm_users`.`status` = true  `api_groups`.`name`= ('#{apigroup_name}'))



By the above query i can retrieve all fields from db,


What i want to do now is to
apigroup_name=[production,marketing] 
-- (multiple table)

loginid=43

email=t...@test.com

want to retrieve all the fields from db,


clientapp= ActiveRecord::Base.connection.execute(SELECT
`sdm_users`.`loginid`,`sdm_users`.id,`sdm_users`.`email`,`api_groups`.`name`,`api_groups`.`is_autokey_generate`,`api_groups`.`id`
FROM `sdm_users`,`api_groups` WHERE `sdm_users`.`loginid`
='#{loginid}'  `sdm_users`.`status` = true  `api_groups`.`name` IN
('#{apigroup_name}'))

it is not working can anybody 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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Current situation with chained order scopes

2011-02-16 Thread Colin Law
I have found various blogs and comments on the issue of merging order
scopes but have not been able to determine whether the current
situation is regarded as satisfactory.

Using Rails 3.0.4, the particular case I am considering is
Item.order( 'x DESC').order('x ASC')
This appears to merge the sorts in the wrong order so that the result
is x DESC.  The sql generated is
SELECT 'items'.* FROM 'items' ORDER BY id DESC, id ASC
Which results in descending order (SQL is rather non-intuitive here).

One result is that it is not possible (as far as I can see) to
override a default or named scope that applies a sort order.

Perhaps I am missing something obvious.

Colin

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Solving a problem: keep tracking of an index through controller view

2011-02-16 Thread Felipe Espinoza Castillo
thanks, that was my problem, I will try to adapt that episode to rails 3, 
but the essence of the problem was the same.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] newbie: page. rjs stuff

2011-02-16 Thread tom
hi,

following code:

page.replace_html divNotifier#{params[:m].to_i}, Notification email got
sent out!
page.visual_effect :Highlight, divNotifier#{params[:m].to_i} , :duration
= 3
page.visual_effect :fade, divNotifier#{params[:m].to_i}, :duration = 2,
:delay = 10


works only the first time, another press on the submit_tag for the
remote_form doesnt work...

i dont see it
anyone?
thx

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails]

2011-02-16 Thread Frederick Cheung

 
 clientapp= ActiveRecord::Base.connection.execute(SELECT 
 `sdm_users`.`loginid`,`sdm_users`.id,`sdm_users`.`email`,`api_groups`.`name`,`api_groups`.`is_autokey_generate`,`api_groups`.`id`
  FROM `sdm_users`,`api_groups` WHERE `sdm_users`.`loginid` ='#{loginid}'  
 `sdm_users`.`status` = true  `api_groups`.`name` IN ('#{apigroup_name}'))
 
 it is not working can anybody help me
Your in clause needs to look like in ('value1', 'value2')
But why use such a low level api when you could use something much nicer?

Fred
 
 -- 
 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@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Mauro
On 16 February 2011 16:14, Felipe Espinoza Castillo
fespinozac...@gmail.com wrote:
 On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
 wrote:
 On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com wrote:
  ... But if anyone knows an editor that has
  tree based file viewer in itself and not as a plugin please let me
  know. And yeah, it should be free.

 I believe it's already been mentioned: jEdit  (http://jedit.org/)

 It's free and extremely configurable/extensible.

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 twitter: @hassan

 I totally recommend you to use Vim, specially the GUI version,
 there is a lot of great plugins that increase the usability and the
 power of the editor so much, it's really great

 I leave you a link to my github vim repository, there are my
 customizations
 so it'll be easier for you have a great configuration in Vim


With vim I can't open an entire directory to browse, for example if I
want to edit the files of a rails project I have to open file one by
one, instead with redcar I can open the directory and see the entire
rails project tree.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread David Kahn
On Wed, Feb 16, 2011 at 12:57 PM, Mauro mrsan...@gmail.com wrote:

 On 16 February 2011 16:14, Felipe Espinoza Castillo
 fespinozac...@gmail.com wrote:
  On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
  wrote:
  On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com
 wrote:
   ... But if anyone knows an editor that has
   tree based file viewer in itself and not as a plugin please let me
   know. And yeah, it should be free.
 
  I believe it's already been mentioned: jEdit  (http://jedit.org/)
 
  It's free and extremely configurable/extensible.
 
  --
  Hassan Schroeder  hassan.schroe...@gmail.com
  twitter: @hassan
 
  I totally recommend you to use Vim, specially the GUI version,
  there is a lot of great plugins that increase the usability and the
  power of the editor so much, it's really great
 
  I leave you a link to my github vim repository, there are my
  customizations
  so it'll be easier for you have a great configuration in Vim
 

 With vim I can't open an entire directory to browse, for example if I
 want to edit the files of a rails project I have to open file one by
 one, instead with redcar I can open the directory and see the entire
 rails project tree.


Try the NERDTree plugin -- works great for this.



 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Mauro
On 16 February 2011 19:11, David Kahn d...@structuralartistry.com wrote:


 On Wed, Feb 16, 2011 at 12:57 PM, Mauro mrsan...@gmail.com wrote:

 On 16 February 2011 16:14, Felipe Espinoza Castillo
 fespinozac...@gmail.com wrote:
  On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
  wrote:
  On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com
  wrote:
   ... But if anyone knows an editor that has
   tree based file viewer in itself and not as a plugin please let me
   know. And yeah, it should be free.
 
  I believe it's already been mentioned: jEdit  (http://jedit.org/)
 
  It's free and extremely configurable/extensible.
 
  --
  Hassan Schroeder  hassan.schroe...@gmail.com
  twitter: @hassan
 
  I totally recommend you to use Vim, specially the GUI version,
  there is a lot of great plugins that increase the usability and the
  power of the editor so much, it's really great
 
  I leave you a link to my github vim repository, there are my
  customizations
  so it'll be easier for you have a great configuration in Vim
 

 With vim I can't open an entire directory to browse, for example if I
 want to edit the files of a rails project I have to open file one by
 one, instead with redcar I can open the directory and see the entire
 rails project tree.

 Try the NERDTree plugin -- works great for this.

It is also for vim-gtk?

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Felipe Espinoza Castillo
yeah,

look for the bundle directory in my vim repository, there are all the 
plugins I use for rails development,
look for each one to know about what they do

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Current situation with chained order scopes

2011-02-16 Thread Julian Leviston
Actually it's doing multiple field ordering... It's best to think of the orders 
as compounding not replacing each other. Easiest to see if you have two 
different cols rather than the same one... For example created_at desc, name 
asc will sort on creation date and then name... So for all records where the 
dates are identical, it will then sort on name alpha ascending... Understand?

Blog: http://random8.zenunit.com/
Twitter: http://twitter.com/random8r
Learn: http://sensei.zenunit.com/
New video up now at http://sensei.zenunit.com/ real fastcgi rails deploy 
process! Check it out now!


On 17/02/2011, at 4:38 AM, Colin Law clan...@googlemail.com wrote:

 I have found various blogs and comments on the issue of merging order
 scopes but have not been able to determine whether the current
 situation is regarded as satisfactory.
 
 Using Rails 3.0.4, the particular case I am considering is
 Item.order( 'x DESC').order('x ASC')
 This appears to merge the sorts in the wrong order so that the result
 is x DESC.  The sql generated is
 SELECT 'items'.* FROM 'items' ORDER BY id DESC, id ASC
 Which results in descending order (SQL is rather non-intuitive here).
 
 One result is that it is not possible (as far as I can see) to
 override a default or named scope that applies a sort order.
 
 Perhaps I am missing something obvious.
 
 Colin
 
 -- 
 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@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.
 

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problems working with Legacy database - associations

2011-02-16 Thread Mark


On Feb 16, 3:21 am, Frederick Cheung frederick.che...@gmail.com
wrote:
 On 15 Feb 2011, at 20:26, Mark ander...@mitre.org wrote:





  In the Rails console:

  irb ts = TableSchema.find(:first, :conditions = table_name =
  'ENTITY_INST')
  = [#TableSchema ID: 88E65D47-621C-4DD6-BD6F-B9ABD93437F8,
  TABLE_NAME: ENTITY_INST, DISPLAY_NAME: Entity Instance
  , TYPE: 1, DESCR: All \real things\ - by label, DELETED_FLAG:
  false, CLASS_ID: 085F7B9E-399D-48AD-A7A3-2AD48769F99B]

  irb ts.my_objects
  NoMethodError: undefined method `my_objects' for #Array:0x47c5830

  irb c = Classification.last
  = #Classification ID: 3E3A8383-8469-4847-8485-C6761B09FD46,
  CLASS_TEXT: UNCLASSIFIED

  irb c.my_objects
  = []

  1. Why is ts.my_objects not defined, but c.my_objects IS (apparently)
  defined?

 It looks like you're getting an array containing a single object back, rather 
 than that single object. Not sure why.


No, I'm getting a NoMethodError: undefined method `my_objects' from
ts.my_objects, and I'm getting an empty array from c.my_objects.

  2. c.my_objects should return dozens of MyObject objects.  Why does it
  return none?

 Does the SQL generated (check the log file) look right?

The SQL generated by c.my_objects is:

SELECT [object].* FROM [object] WHERE ([object].class_id = NULL)

Obviously, class_id = NULL is incorrect.  My guess is that NULL is
the return value of a call to c.id, and indeed, c.id return nil.  c.ID
returns the correct value.  I think that I need to add a method called
id that returns ID.  Is that right? How do I do that?

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Depracation warning style block helpers

2011-02-16 Thread S. Widmann
Hi,

I have some code like this:
% @events.each do |event| %

But I get a deprecation warning: DEPRECATION WARNING: style block helpers 
are deprecated. Please use . 

When I use %= @events.each do |event| %, there is some unwanted output, 
that is being generated by @events.each. What do I have to do, to get it 
working correctly and get no deprecation warning?

Regards
sewid

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] 3.0.4 change to chained where methods. Documentation?

2011-02-16 Thread Mark Kremer

Thanks for posting that link :)

After reading a bit more I tend to agree with you that chaining where 
multiple times should result in an AND, and not in an OR (even though 
the example of doing a .where on the same attribute twice is a little silly)


On 16-2-2011 12:43, Colin Law wrote:

On 16 February 2011 09:44, Colin Lawclan...@googlemail.com  wrote:

On 16 February 2011 05:42, Mark Kremerm...@without-brains.net  wrote:

It may seem a bit odd with the where method chained twice like that, but the
query with the OR (Rails 3.0.4) will probably get you the result you want
whereas the query with the AND (Rails 3.0.3) will return 0 records at all
times (because the same attribute can't have two values).

I disagree that OR is the result one would want if one were to code
this.  I agree it is apparently a useless query and obviously one
would not code it exactly like this.  If the sql for this is
incorrectly generated however, it is likely that a more subtle, and
useful, query may also be encoded wrongly.  The principle of chained
where is that the first one is performed, then the next is performed
on the results of the first.  At least that is how I understand it.

Consider:
State.where(:abbreviation ='TX').where(abbreviation =  'NE')
This (correctly in my view) uses AND in the query.
As 3.0.4 stands at the moment the above yields a different result to
State.where(:abbreviation ='TX').where(:abbreviation ='NE')
which seems incorrect to me.

I will post on rails-core to see what the response is there.

I posted to rails-core and apparently it is by design rather than a
bug.  The question seems to have stirred up a bit of a furore however,
see 
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/407f746fd1de6636

Colin



--
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: howto implement a join table

2011-02-16 Thread rogi

implemented Ar Chrons idea.

Now I wanted to replace the text fields with select boxes.
They look right and let me select values, but the table fields for
worker_id and course_id

don't get filled: [#Training id: 1, worker_id: nil, course_id:
nil, ...

my form partial _form.html.erb looks like:
.
div class=field
%= select_tag 'worker_id', options_for_select(Worker.all.collect { |
w| [w.first_name+ +w.last_name, w.id] }) %

  /div
  div class=field
%= select_tag 'course_id', options_for_select(Course.all.collect
{ |c| [c.name, c.id] }) %

  /div
  div class=field
%= f.label :start_date %br /
%= f.datetime_select :start_date %
  /div
..

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Depracation warning style block helpers

2011-02-16 Thread Frederick Cheung


On Feb 16, 8:29 pm, S. Widmann sebastian.widm...@gmail.com wrote:
 Hi,

 I have some code like this:
 % @events.each do |event| %

 But I get a deprecation warning: DEPRECATION WARNING: style block helpers
 are deprecated. Please use .

 When I use %= @events.each do |event| %, there is some unwanted output,
 that is being generated by @events.each. What do I have to do, to get it
 working correctly and get no deprecation warning?

% @events.each do |event| % should be fine. Are you sure there isn't
something else on the page generating the deprecation warning?

Fred


 Regards
 sewid

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Which editor to use

2011-02-16 Thread Culley
I have searched long and hard for a great editor in Linux as well.
I've tried vim, gedit (w/ gmate and rails plugins making it more like
TextMate), and jEdit. I've also used IDE's like Eclipse, Netbeans, and
Aptana.  However, I keep coming back to Komodo Edit.  It's free, it
has a side-pane, like you requested, and a fair amount of plugins if
you need them.  I set up several aliases to run Komodo from the
command line and open working directories.

As my own preference, and because I have multiple monitors, I like to
use a terminal-multiplexer (tmux) inside of a drop-down terminal
(guake) on one monitor.  Then on the other, I have my editor, Komodo
Edit.  I've found this setup more comfortable than using an IDE.

If I'm a low power machine w/ a single monitor, like a laptop, then I
tend to rely on gedit + gmate/rails plugins alongside the same drop-
down terminal + multiplexer setup.

Culley

On Feb 16, 1:11 pm, David Kahn d...@structuralartistry.com wrote:
 On Wed, Feb 16, 2011 at 12:57 PM, Mauro mrsan...@gmail.com wrote:
  On 16 February 2011 16:14, Felipe Espinoza Castillo
  fespinozac...@gmail.com wrote:
   On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
   wrote:
   On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com
  wrote:
... But if anyone knows an editor that has
tree based file viewer in itself and not as a plugin please let me
know. And yeah, it should be free.

   I believe it's already been mentioned: jEdit  (http://jedit.org/)

   It's free and extremely configurable/extensible.

   --
   Hassan Schroeder  hassan.schroe...@gmail.com
   twitter: @hassan

   I totally recommend you to use Vim, specially the GUI version,
   there is a lot of great plugins that increase the usability and the
   power of the editor so much, it's really great

   I leave you a link to my github vim repository, there are my
   customizations
   so it'll be easier for you have a great configuration in Vim

  With vim I can't open an entire directory to browse, for example if I
  want to edit the files of a rails project I have to open file one by
  one, instead with redcar I can open the directory and see the entire
  rails project tree.

 Try the NERDTree plugin -- works great for this.



  --
  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@googlegroups.com.
  To unsubscribe from this group, send email to
  rubyonrails-talk+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Fábio Rodriguez
I'm using TextMate and I love itŠ Simple to use with low cost and lots of
benefits!

http://macromates.com/

From:  David Kahn d...@structuralartistry.com
Reply-To:  rubyonrails-talk@googlegroups.com
Date:  Wed, 16 Feb 2011 13:11:20 -0600
To:  rubyonrails-talk@googlegroups.com
Subject:  Re: [Rails] Re: Which editor to use


On Wed, Feb 16, 2011 at 12:57 PM, Mauro mrsan...@gmail.com wrote:
 On 16 February 2011 16:14, Felipe Espinoza Castillo
 fespinozac...@gmail.com wrote:
  On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
  wrote:
  On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com wrote:
   ... But if anyone knows an editor that has
   tree based file viewer in itself and not as a plugin please let me
   know. And yeah, it should be free.
 
  I believe it's already been mentioned: jEdit  (http://jedit.org/)
 
  It's free and extremely configurable/extensible.
 
  --
  Hassan Schroeder  hassan.schroe...@gmail.com
  twitter: @hassan
 
  I totally recommend you to use Vim, specially the GUI version,
  there is a lot of great plugins that increase the usability and the
  power of the editor so much, it's really great
 
  I leave you a link to my github vim repository, there are my
  customizations
  so it'll be easier for you have a great configuration in Vim
 
 
 With vim I can't open an entire directory to browse, for example if I
 want to edit the files of a rails project I have to open file one by
 one, instead with redcar I can open the directory and see the entire
 rails project tree.

Try the NERDTree plugin -- works great for this.
 
 
 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com
 mailto:rubyonrails-talk%2bunsubscr...@googlegroups.com .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.
 


-- 
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@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Limitations on parameters in routes?

2011-02-16 Thread Peter Bell
I have the following route:

get /places/:lat/:lng = api#places

When I go to /places/1/2 it works fine
When I try to go to /places/40.728601/-73.991972 (a useful lat/lng) I get a 
Routing error: No route matches /api/v11/places/40.728601/-73.991972

Any suggestions on how I can get this working? I know I could put the latlng 
into a query string, but it seems a little more RESTful to have it as part of 
the URI.

Best Wishes,
Peter

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Fwd: Limitations on parameters in routes?

2011-02-16 Thread Peter Bell
Follow up - looks like the router is choking on the periods. Without those it 
is fine.

I could just transform . into _ to have routes like
/places/40_728601/-73_991972

Any thoughts? Any better way to go about this (while using bound parameters as 
opposed to query strings to keep with the spirit of distinct, meaningful URI's?

Best Wishes,
Peter

Begin forwarded message:

 From: Peter Bell pe...@pbell.com
 Date: February 16, 2011 6:02:13 PM EST
 To: rubyonrails-talk@googlegroups.com
 Subject: Limitations on parameters in routes?
 
 I have the following route:
 
 get /places/:lat/:lng = api#places
 
 When I go to /places/1/2 it works fine
 When I try to go to /places/40.728601/-73.991972 (a useful lat/lng) I get a 
 Routing error: No route matches /api/v11/places/40.728601/-73.991972
 
 Any suggestions on how I can get this working? I know I could put the latlng 
 into a query string, but it seems a little more RESTful to have it as part of 
 the URI.
 
 Best Wishes,
 Peter

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Limitations on parameters in routes?

2011-02-16 Thread Philip Hallstrom

On Feb 16, 2011, at 3:02 PM, Peter Bell wrote:

 I have the following route:
 
 get /places/:lat/:lng = api#places
 
 When I go to /places/1/2 it works fine
 When I try to go to /places/40.728601/-73.991972 (a useful lat/lng) I get a 
 Routing error: No route matches /api/v11/places/40.728601/-73.991972
 
 Any suggestions on how I can get this working? I know I could put the latlng 
 into a query string, but it seems a little more RESTful to have it as part of 
 the URI.

Add a requirement that :lat and :lng match /[-\d.]/

-philip

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Error: uninitialized constant MysqlCompat::MysqlRes

2011-02-16 Thread Matthew Werner
Hi All,

This has been the most thorough discussion of the topic I've found. I've
spent far too much time trying to get this stupid gem to work. I'm going
to post the information i've got and I'm praying someone out there will
be able to help me.

 ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
 mysql --version
mysql  Ver 14.14 Distrib 5.5.9, for osx10.6 (i386) using readline 5.1
 rails -v
Rails 2.3.5
 sudo gem uninstall mysql
Successfully uninstalled mysql-2.8.1

Here is where I've seen so so (SO) many different recommendations on
what to do. I've tried damn near everything, both sudo and not,
specifying my arch flags and not. I'll just go with the most thorough:

 export ARCHFLAGS=-arch i386 ; sudo gem install --no-rdoc --no-ri mysql --
--with-mysql-dir=/usr/local 
--with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.8.1
1 gem installed

 rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
= Environment: Development
** Execute db:migrate
rake aborted!
uninitialized constant MysqlCompat::MysqlRes
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in
`load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in
`const_missing'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:9:in
`define_all_hashes_method!'

I'm lost on what else it could be. I feel like I've tried every
combination. I've tried reinstalling ruby, 64bit of mysql, please help. 
I'm out of ideas.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] newbie: page. rjs stuff

2011-02-16 Thread Jim Ruther Nill
you're hiding the div when you use the fade effect. so the next time you
submit the form, the div is changed but
it's hidden.  try showing the div before the highlight effect.

On Thu, Feb 17, 2011 at 2:25 AM, tom tomabr...@gmail.com wrote:

 hi,

 following code:

 page.replace_html divNotifier#{params[:m].to_i}, Notification email got
 sent out!
 page.visual_effect :Highlight, divNotifier#{params[:m].to_i} , :duration
 = 3
 page.visual_effect :fade, divNotifier#{params[:m].to_i}, :duration = 2,
 :delay = 10


 works only the first time, another press on the submit_tag for the
 remote_form doesnt work...

 i dont see it
 anyone?
 thx



  --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 
-
visit my blog at http://jimlabs.heroku.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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problems working with Legacy database - associations

2011-02-16 Thread Robert Pankowecki (rupert)

 Obviously, class_id = NULL is incorrect.  My guess is that NULL is
 the return value of a call to c.id, and indeed, c.id return nil.  c.ID
 returns the correct value.  I think that I need to add a method called
 id that returns ID.  Is that right? How do I do that?

Maybe try
set_primary_key 'ID'
instead of
set_primary_key 'id'

?

Robert Pankowecki

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Current situation with chained order scopes

2011-02-16 Thread Robert Pankowecki (rupert)
If you want to change the order instead of adding another column to
ordering list then there is reorder() method which is however
deprecated in Rails 3.1 in favor of except(:order).order(new order
here)

Robert Pankowecki

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Auto complete using prototype in Rails 3

2011-02-16 Thread Karthikeyan A k
Hello People,

Is there a any way to do autocomplete text field in Rails 3 without
using jquery and by using built in prototype?

It came so well in Rails 2, whereas in Rails 3 it seems not to work.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails]

2011-02-16 Thread loganathan sellappa
Hi all,

array=[api,api2]
array.join(',')
i get ''api,api2
wat i want is 'api','api2'



how can i get it

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Depracation warning style block helpers

2011-02-16 Thread S. Widmann
Hi,

I'm pretty sure. The hole code is: https://gist.github.com/831041

The deprecation warning is:
DEPRECATION WARNING: style block helpers are deprecated. Please use . 
(called from 
_app_views_events_duplicates_show_js_erb___2237124407041796622_2181332520__676939742015288370
 
at /sites/sampleapp/app/views/events/duplicates/show.js.erb:4)

Regards,
sewid

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Which editor to use

2011-02-16 Thread Norbert Melzer
Yeah, and it is Mac only, the OP asked for a editor usable in Ubuntu-Linux

Top posted from android

Am 16.02.2011 23:27 schrieb Fábio Rodriguez braj...@brajola.com:
 I'm using TextMate and I love itŠ Simple to use with low cost and lots of
 benefits!

 http://macromates.com/

 From: David Kahn d...@structuralartistry.com
 Reply-To: rubyonrails-talk@googlegroups.com
 Date: Wed, 16 Feb 2011 13:11:20 -0600
 To: rubyonrails-talk@googlegroups.com
 Subject: Re: [Rails] Re: Which editor to use


 On Wed, Feb 16, 2011 at 12:57 PM, Mauro mrsan...@gmail.com wrote:
 On 16 February 2011 16:14, Felipe Espinoza Castillo
 fespinozac...@gmail.com wrote:
  On Feb 16, 11:24 am, Hassan Schroeder hassan.schroe...@gmail.com
  wrote:
  On Wed, Feb 16, 2011 at 5:00 AM, Arun Srini arunro...@gmail.com
wrote:
   ... But if anyone knows an editor that has
   tree based file viewer in itself and not as a plugin please let
me
   know. And yeah, it should be free.
 
  I believe it's already been mentioned: jEdit (http://jedit.org/)
 
  It's free and extremely configurable/extensible.
 
  --
  Hassan Schroeder  hassan.schroe...@gmail.com
  twitter: @hassan
 
  I totally recommend you to use Vim, specially the GUI version,
  there is a lot of great plugins that increase the usability and the
  power of the editor so much, it's really great
 
  I leave you a link to my github vim repository, there are my
  customizations
  so it'll be easier for you have a great configuration in Vim
 

 With vim I can't open an entire directory to browse, for example if I
 want to edit the files of a rails project I have to open file one by
 one, instead with redcar I can open the directory and see the entire
 rails project tree.

 Try the NERDTree plugin -- works great for this.


 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com
 mailto:rubyonrails-talk%2bunsubscr...@googlegroups.com .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.


 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails]

2011-02-16 Thread Jim Ruther Nill
a little hackish but

'#{array.join('\',\'')}'

or

array.join(',').inspect.gsub(/\[\]/, '')

On Thu, Feb 17, 2011 at 12:55 PM, loganathan sellappa loganathan.ms@
gmail.com wrote:

 Hi all,

 array=[api,api2]
 array.join(',')
 i get ''api,api2
 wat i want is 'api','api2'



 how can i get it

  --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 
-
visit my blog at http://jimlabs.heroku.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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails]

2011-02-16 Thread Norbert Melzer
Can't try it out because I can't reach my development machine and I did not
need such behavior but intuitively I would try

' + array.join(',') + '

it is  followed by ' for opening and vice versa for closing. The ' in the
resulting string at the beginning and the end had to be added manually by
adding '.

HTH
Norbert

Top posted from android

Am 17.02.2011 05:55 schrieb loganathan sellappa loganathan...@gmail.com:
 Hi all,

 array=[api,api2]
 array.join(',')
 i get ''api,api2
 wat i want is 'api','api2'



 how can i get it

 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Depracation warning style block helpers

2011-02-16 Thread Norbert Melzer
The depracated warning is caused by your url_for I would guess.

Can't test it because my development machine crashed yesterday

Top posted from android

Am 17.02.2011 06:30 schrieb S. Widmann sebastian.widm...@gmail.com:
 Hi,

 I'm pretty sure. The hole code is: https://gist.github.com/831041

 The deprecation warning is:
 DEPRECATION WARNING: style block helpers are deprecated. Please use .
 (called from

_app_views_events_duplicates_show_js_erb___2237124407041796622_2181332520__676939742015288370

 at /sites/sampleapp/app/views/events/duplicates/show.js.erb:4)

 Regards,
 sewid

 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Depracation warning style block helpers

2011-02-16 Thread S. Widmann
What would be the correct url_for syntax?

Regards,
sewid

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Adding images for pagination links in will_paginate

2011-02-16 Thread Tushar Gandhi
Hi,
I am using will_paginate for pagination.
I have to show only Previous and Next links, that I have achieved by
:page_links=false parameter.
Now I want to show the images instead of Previous and Next labels.

Can anyone tell how to achieve this in will_paginate?

Thanks,
Tushar

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails]

2011-02-16 Thread Michael Pavling
On 17 February 2011 04:55, loganathan sellappa loganathan...@gmail.com wrote:
 array=[api,api2]
 wat i want is 'api','api2'
 how can i get it

array.map{|e| '#{e}'}.join(',')

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Adding images for pagination links in will_paginate

2011-02-16 Thread Jim Ruther Nill
set the previous and next labels to '' or 'nbsp;' if it won't allow blank
labels.
then look at the class of the labels and apply css styling.

On Thu, Feb 17, 2011 at 2:48 PM, Tushar Gandhi li...@ruby-forum.com wrote:

 Hi,
 I am using will_paginate for pagination.
 I have to show only Previous and Next links, that I have achieved by
 :page_links=false parameter.
 Now I want to show the images instead of Previous and Next labels.

 Can anyone tell how to achieve this in will_paginate?

 Thanks,
 Tushar

 --
 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@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 
-
visit my blog at http://jimlabs.heroku.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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Which editor to use

2011-02-16 Thread Denzil
I would just try every editor out there for a few days or for a week
per and find out which one works best for you.

I personally use Texmate and I like it a lot. I have used NetBeans
before and while it is great, I don't like the fact that it's so
resource heavy.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Unindent ERB output

2011-02-16 Thread khoan
Hi all,

I'd like to unindent a block of ERB specifically to combat the extra
spacing being added to content inside textarea by the browser. Is
there such a feature in ERB?

I shall denote indentation with underscores in the pseudo code example
below.

Thanks in advance,
Khoan.


myview.erb:

html ...
__%= render 'form' %
/html


_form.erb:

% form_for ... do %
__%= render 'unindented' %
% end %


_unindented.erb:

textarea%= 'this is unindented' %/textarea


which would output something along the line of:

html ...
__form ...
textareathis is unindented/textarea
__/form
/html

I want something to this effect:

html ...
__form ...
textareathis is unindented/textarea
__/form
/html

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Depracation warning style block helpers

2011-02-16 Thread Frederick Cheung


On Feb 17, 5:30 am, S. Widmann sebastian.widm...@gmail.com wrote:
 Hi,

 I'm pretty sure. The hole code is:https://gist.github.com/831041

 The deprecation warning is:
 DEPRECATION WARNING: style block helpers are deprecated. Please use .
 (called from
 _app_views_events_duplicates_show_js_erb___2237124407041796622_2181332520__ 
 676939742015288370
 at /sites/sampleapp/app/views/events/duplicates/show.js.erb:4)

Is this definitely the right file? The warning mentions a js.erb file
and then file you've posted looks like just regular erb.

Fred

 Regards,
 sewid

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.