[Rails] Re: Finding the next item, in a group of items.

2010-05-09 Thread youtube
Y'know I think this topic is too long anyway, so I'm probably going to create a new topic on the issue tonight (unless someone wants to reply between now and then). Thanks For Your Help Guys! Joe On May 9, 4:43 pm, Joe wrote: > Bump?! This is this final step, please can anyoe help me? > > Thank

[Rails] Re: Decorator pattern in Ruby... what do you think about the implementation?

2010-05-09 Thread Samiron
Hello Peter and Michael, Thanks for your comments. Keep tuned up with my blog. I will be investigating on more design patterns to implement in Ruby (not in Rails style) :D and of course need to thoughts to share. Samiron paul http://samironpaul.blogspot.com On May 10, 1:19 am, Peter De Berdt wro

[Rails] Re: Webrick Starts but Page never not loads the first time

2010-05-09 Thread Greg
I'm running windows xp at work where this problem occurs. However, it seems to work fine at home where I run windows 7. I have used mongrel as well and same problem occurs. What do you do when webrick giver internal server errors? On May 8, 4:56 am, Karthikeyan wrote: > I use Ubuntu 10.04, my w

[Rails] Rails 3: Get the original filename from file uploads

2010-05-09 Thread Joshua Partogi
Hi all, I am currently using Rails 3 and I am using it to upload a file. How do I get the original filename using Rails 3? Because when I use File.basename(), what I get is RackFileUpload and not the original filename. Has anyone done this before and can share it with us here? Kind regards, Joshu

[Rails] Re: web2py and rails on Windows

2010-05-09 Thread mdipierro
I apologize. Posted to the wrong list. Feeling like a fool! On May 9, 8:12 pm, mdipierro wrote: > In relation to this > discussion:http://groups.google.com/group/rubyonrails-talk/msg/654445a5da339885 > > I am not a windows user but I know many of you are. > > What is your impression on web2py on

[Rails] web2py and rails on Windows

2010-05-09 Thread mdipierro
In relation to this discussion: http://groups.google.com/group/rubyonrails-talk/msg/654445a5da339885 I am not a windows user but I know many of you are. What is your impression on web2py on windows? Is there any issue that is windows specific? I think portability is and should be considered one

[Rails] Re: New to web app development -- ROR pros and cons

2010-05-09 Thread Matt Jones
On May 9, 11:10 am, mdipierro wrote: > In the past I have used Rails on both windows and linux without > problems. Some posts here seem to imply that Rails runs better on > Linux. Are you saying there is a problem with Rails on Windows? There's nothing inherently wrong with Rails on Windows, bu

[Rails] Rails,RSpec,Rcov,Lib

2010-05-09 Thread Chris Kilmer
Okay, I've probably just been staring at this for too long, but here is the problem I hope to get some help with: I'm creating a little lib directly inside rails for integrating with Plesk. I'm also creating two custom rake tasks to get test and coverage results just on the plesk stuff. Problem

[Rails] Re: saving a "found_by_sql" AR

2010-05-09 Thread Frederick Cheung
On May 9, 7:41 pm, Fearless Fool wrote: > Michael Pavling wrote: > >> But since you asked (and since you've impugned my knowledge of SQL :), > > Um, don't get offended... > > No offense taken - that's what the smiley face was for.  The first case > was designed as a simple case to demonstrate th

[Rails] Re: "File not found: lib" installing rails-3.0.0.beta3 on my Mac

2010-05-09 Thread Frank
On May 8, 10:39 pm, Frank wrote: > I've always distrusted the ruby and rails installs on my Mac (oOS X > 10.6.3) -- sudo gem cleanup can't seem to get rid of old gem versions > (lots of Gem::InstallError: cannot uninstall). > > Because of that, I don't trust the rails beta3 install I just > comp

Re: [Rails] Decorator pattern in Ruby... what do you think about the implementation?

2010-05-09 Thread Peter De Berdt
On 09 May 2010, at 20:54, Michael Pavling wrote: On 9 May 2010 19:39, Peter De Berdt wrote: About your implementation, I prefer the syntax from the post above, simply because it reads more natural. Other than that, yours does seem a viable solution (only skimmed it, but seems fine) :-)

Re: [Rails] how to access variable in 3 level (model,controller,view)

2010-05-09 Thread Vladimir Rybas
In declarative_authorization you can do before_filter {|c| Authorization.current_user = c.current_user} in ApplicationController, then call using_access_control in Model, and you get current_user(or something like that) in your model. Check how they do it. Also, there is a hack fro

[Rails] Re: Re: saving a "found_by_sql" AR

2010-05-09 Thread Fearless Fool
By the way, to avert any confusion, I should strike the word "query" from my last question and ask it this was: And (most importantly) what other methods could you call on the object that would predict this mis-behavior? - ff -- Posted via http://www.ruby-forum.com/. -- You received this mes

Re: [Rails] Decorator pattern in Ruby... what do you think about the implementation?

2010-05-09 Thread Michael Pavling
On 9 May 2010 19:39, Peter De Berdt wrote: > About your implementation, I prefer the syntax from the post above, simply > because it reads more natural. Other than that, yours does seem a viable > solution (only skimmed it, but seems fine) :-) It's an interesting pure Ruby implementation, but it'

[Rails] Re: Re: saving a "found_by_sql" AR

2010-05-09 Thread Fearless Fool
Michael Pavling wrote: >> But since you asked (and since you've impugned my knowledge of SQL :), > Um, don't get offended... No offense taken - that's what the smiley face was for. The first case was designed as a simple case to demonstrate that there's something fishy about how SELECT column

Re: [Rails] Decorator pattern in Ruby... what do you think about the implementation?

2010-05-09 Thread Peter De Berdt
On 09 May 2010, at 08:28, Samiron wrote: I was wondering about how you guys are implementing the decorator patterns in Ruby? Here is a thought to share with. http://digs.by/9Rezfs . Could you please share your thoughts about this implementation? You could easily do that in a few lines: htt

Re: [Rails] [JOBS] Ruby Development Opportunities with ideeli.com

2010-05-09 Thread Christoph Jasinski
Dear Gerardo, Please don't send your CV to the mailing list. As instructed: "If you have specific questions about applying or job requirements, I can be reached at eh...@ideeli.com." Good luck with your application for job Chris -- You received this message because you are subscribed to t

[Rails] Re: Multiple has_many through join table appears multiple times

2010-05-09 Thread all4 miller
ended up using Sales.find(... which generated the correct sql -- 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 unsubscrib

[Rails] Re: hostingrails.com appears to have had an ownership change

2010-05-09 Thread Rick
The original estimate of 24-72 hours is currently off by over a week. I currently experience site halts of over 5 minutes more than twice daily. My git repository suddenly reverted to the first commit. I had to rebuild my development history from a git clone. Fortunately all history was present

[Rails] Problem in installing community_engine plugin

2010-05-09 Thread Utkarsh Sengar
Hi, I am new to ROR and trying to deploy the community_engine module to a clean ROR project. When I follow all the instructions here: http://github.com/bborn/communityengine/blob/master/README.markdown And run " ./generate plugin_migration" I get this error: vendor/plugins/community_engine/con

[Rails] Problem in installing Community

2010-05-09 Thread Utkarsh Sengar
Hi, I am new to ROR and trying to deploy the community_engine module to a clean ROR project. When I follow all the instructions here: http://github.com/bborn/communityengine/blob/master/README.markdown And run " ./generate plugin_migration" I get this error: vendor/plugins/community_engine/con

[Rails] Re: sorting a listing page

2010-05-09 Thread Tom Mac
Hi I still could not get an exact choice. I found this http://www.2dconcept.com/jquery-grid-rails-plugin But suppose if have a column like full_name but it is not a db column ( i have db columns firstname and lastname) then what I will do? If anybody has any other choice than please help

[Rails] Re: Finding the next item, in a group of items.

2010-05-09 Thread Joe
Bump?! This is this final step, please can anyoe help me? Thanks In Advance, Please Help, Joe On May 8, 7:33 am, Joe wrote: > I've just tried using this in routes.rb: > map.resources :tutorials, :path_prefix => '/categories/:category_id' > > However the link isn't changing, it's still just goi

Re: [Rails] Re: saving a "found_by_sql" AR

2010-05-09 Thread Michael Pavling
On 9 May 2010 16:06, Fearless Fool wrote: > Michael Pavling wrote: > The point of my question is that the save! silently fails, which > surprises me. > save! returns true yet doesn't save the record: how is this not a bug? It doesn't fail... the SQL works perfectly. Go into your favourite SQL que

[Rails] Re: saving a "found_by_sql" AR

2010-05-09 Thread Marnen Laibow-Koser
Fearless Fool wrote: > Michael Pavling wrote: >> Coming back to my first thought when I read your code: WTF? What are >> you *trying* to do?! Why are you hoping to achieve with that >> find_by_sql? Are you trying to find the first record you created? If >> so, you need to learn some SQL: >> >> b =

[Rails] Re: how to access variable in 3 level (model,controller,vie

2010-05-09 Thread Marnen Laibow-Koser
Fuyi wrote: > how to access variable in 3 level (model,controller,view) > > i use session[:current_unit] only can in C and V > can't access in M > > i mean is use a goloble variable can access in anywhere You probably don't want to use a global variable for this. > > Such as: > user slec

[Rails] Re: New to web app development -- ROR pros and cons

2010-05-09 Thread mdipierro
In the past I have used Rails on both windows and linux without problems. Some posts here seem to imply that Rails runs better on Linux. Are you saying there is a problem with Rails on Windows? Or are you just suggesting Linux/Mac for the stability of the OS and the availability of other open sourc

[Rails] Re: saving a "found_by_sql" AR

2010-05-09 Thread Fearless Fool
Michael Pavling wrote: > Coming back to my first thought when I read your code: WTF? What are > you *trying* to do?! Why are you hoping to achieve with that > find_by_sql? Are you trying to find the first record you created? If > so, you need to learn some SQL: > > b = Blurg.find_by_sql("SELECT *

[Rails] Re: hostingrails.com appears to have had an ownership change

2010-05-09 Thread Marnen Laibow-Koser
gogo wrote: > Hi, I pretty much had the same issues reported here, especially after > the "upgrade" on some servers. > > The question is: what RoR hosting provider would you suggest ? I've > heard good things about site5, and was myself a happy Lunarpages > customer but I left because at the time

[Rails] how to access variable in 3 level (model,controller,view)

2010-05-09 Thread Fuyi
how to access variable in 3 level (model,controller,view) i use session[:current_unit] only can in C and V can't access in M i mean is use a goloble variable can access in anywhere Such as: user slecet a Unit, in model, before User.save the user.unit_id must set session[:user_id]

[Rails] Fix for compiling Ruby with VS2010 express compiler

2010-05-09 Thread dw
Hi, The first time I compiled ruby using the VS2010 express compiler for the first time and I got an error relating to the miniruby.exe.manifest file not being found. I changed the LDFLAGS in win32\Makefile.sub from: LDFLAGS = -incremental:no -debug -opt:ref -opt:icf to LDFLAGS = -manifest -in

[Rails] Re: user_id being saved as NULL... but why?

2010-05-09 Thread Frederick Cheung
On May 9, 1:55 pm, RubyonRails_newbie wrote: > Hello, > > Good point - I have tried to amend the code like below, but i get > errors: > > ORIGINAL CODE: > Blogpost.find(params[:id]).comments.create(params[:comment]) > > AMENDED CODE 1: > Blogpost.find(params[:id, :user_id]).comments.create(param

[Rails] Re: New to web app development -- ROR pros and cons

2010-05-09 Thread Victor S
If you really really have to use Windows look into cygwin, and bitnamy rubystack http://bitnami.org/stack/rubystack, also JetBrain's http://www.jetbrains.com/ruby/ or SublimeText. But if you can afford a Mac OS X laptop you will be on the same level as 99% of ruby developers... hey, it's what Linu

[Rails] Re: how to generate the Generating SSH keys in github?

2010-05-09 Thread David Zhu
http://help.github.com/linux-key-setup/ On May 9, 6:06 am, ruby rails wrote: > how to generate the Generating SSH keys in github? > > -- > 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

[Rails] Re: user_id being saved as NULL... but why?

2010-05-09 Thread RubyonRails_newbie
Hello, Good point - I have tried to amend the code like below, but i get errors: ORIGINAL CODE: Blogpost.find(params[:id]).comments.create(params[:comment]) AMENDED CODE 1: Blogpost.find(params[:id, :user_id]).comments.create(params[:comment]) THis returns error: wrong number of arguments (2 for

[Rails] Expand TEXT AREA dynamically?

2010-05-09 Thread David Zhu
is there a way to expand a text field when the text reaches past the bottom? -- 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 emai

Re: [Rails] Sharing model validation code in lib/, how do I do this?

2010-05-09 Thread Ants Pants
On 9 May 2010 00:26, Matthew Hillsborough wrote: > Hello everyone, > > I'm having a bit of difficulty finding out the proper way to mix in code > that I put into the lib/ directory for Rails 2.3.5. > > I have several models that require phone validation. I had at least three > models that used the

[Rails] Re: saving a "found_by_sql" AR

2010-05-09 Thread Frederick Cheung
On May 9, 10:02 am, Fearless Fool wrote: > If an active record is returned as a result of a find_by_sql() query, > what must be true in order for it to be save-able?  Here's an example of > it not working: > = > require 'rubygems' > require 'active_record' > ActiveRecord::Schema.define do >

[Rails] how to generate the Generating SSH keys in github?

2010-05-09 Thread ruby rails
how to generate the Generating SSH keys in github? -- 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+uns

[Rails] the view is important

2010-05-09 Thread Pau
I have been developing web applications for only 4 years but this has been enough to know that HTML+CSS+Javascript is the hardest part. Nowadays there exists many javascript libraries such as jQuery and some javascript frameworks such as Ext. But, as you may know, they are very hard to use to creat

Re: [Rails] Re: hostingrails.com appears to have had an ownership change.

2010-05-09 Thread James Oser
support.jumpline.com and support.hostingrails.com seemed to be the same web page except support.hostingrails.com has a forum tab and support.jumpline.com does not have a forum tab. The forum's tab points to http://hostingrails.com/forums There is not a http://jumpline.com/forums -- You recei

Re: [Rails] Re: hostingrails.com appears to have had an ownership change.

2010-05-09 Thread James Oser
I received a 4/24/2010 email from hostingrails.com that states: If you are currently using outside name servers for your website, you will need to either update your DNS name server records for your domain name to ( ns1.hostingrails.com and ns2.hostingrails.com). The above email is wrong, or leas

[Rails] "File not found: lib" installing rails-3.0.0.beta3 on my Mac

2010-05-09 Thread Frank
I've always distrusted the ruby and rails installs on my Mac (oOS X 10.6.3) -- sudo gem cleanup can't seem to get rid of old gem versions (lots of Gem::InstallError: cannot uninstall). Because of that, I don't trust the rails beta3 install I just completed. Here's the story: * config is Apple's

Re: [Rails] how do i loop through children?

2010-05-09 Thread tom
ur right. thx again 4 ur words! On Sun, May 9, 2010 at 5:25 AM, Michael Pavling wrote: > On 9 May 2010 10:11, tom wrote: > > and even if it would work, would it prevent n...@out-ofboundary? > > Try it yourself - explore and find out. Go the the console and play > with arrays. Read the api docs

Re: [Rails] how do i loop through children?

2010-05-09 Thread Michael Pavling
On 9 May 2010 10:11, tom wrote: > and even if it would work, would it prevent n...@out-ofboundary? Try it yourself - explore and find out. Go the the console and play with arrays. Read the api docs which explain what it does. http://ruby-doc.org/core/classes/Array.html#M002205 You'll learn more

Re: [Rails] saving a "found_by_sql" AR

2010-05-09 Thread Michael Pavling
On 9 May 2010 10:02, Fearless Fool wrote: > If an active record is returned as a result of a find_by_sql() query, > what must be true in order for it to be save-able?  Here's an example of > it not working: The clue is in the question... You're not selecting an "active record" (record), you're s

Re: [Rails] how do i loop through children?

2010-05-09 Thread tom
ok, got it: <% category.children.slice(0...4).EACH do |child| %> > i forgot the "each" keyword. thx again! On Sun, May 9, 2010 at 5:11 AM, tom wrote: > strange, slice doesnt give me anything...: > > <% category.children.slice(0...4) do |child| %> > test <%=h child.inspect %> >

Re: [Rails] how do i loop through children?

2010-05-09 Thread tom
strange, slice doesnt give me anything...: <% category.children.slice(0...4) do |child| %> test <%=h child.inspect %> <% end %> i see no "test" ini the resulting view. children are present running the other loop. and even if it would work, would it prevent n...@out-ofboundary?

[Rails] saving a "found_by_sql" AR

2010-05-09 Thread Fearless Fool
If an active record is returned as a result of a find_by_sql() query, what must be true in order for it to be save-able? Here's an example of it not working: = require 'rubygems' require 'active_record' ActiveRecord::Schema.define do create_table(:blurgs, :force => true) {|t| t.string :name

Re: [Rails] how do i loop through children?

2010-05-09 Thread Michael Pavling
On 9 May 2010 09:54, tom wrote: > 2) based on my snippet, inspect works "works" any chance one of the "working" results is "nil" :-/ ><%=h category.children[index].id %> > > gives me: > > Called id for nil, which would mistakenly be 4 -- if you really wanted the > id of nil, use object

Re: [Rails] how do i loop through children?

2010-05-09 Thread tom
hi guys & thx for the suggestions 1) slice: didnt know u can use that on "collections" too, so i give it a try. the boundaries are being checked to not run into a nil situation 2) based on my snippet, insoect works, but if i want to address the attribute like: <%=h category.children[index].id

Re: [Rails] how do i loop through children?

2010-05-09 Thread Michael Pavling
On 9 May 2010 09:35, Michael Pavling wrote: > On 9 May 2010 02:17, tom wrote: >>        <% for index in 0 ... 5 %> > you're looping through six Sorry... three dots... stupid confusing functionality :-/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rai

Re: [Rails] how do i loop through children?

2010-05-09 Thread Michael Pavling
On 9 May 2010 02:17, tom wrote: >        <% for index in 0 ... 5 %> >          <%=h  category.children[index].inspect %> >        <% end %> >> as u can see, in the for-loop i want for example show only 5 children > of that specific children. inspect gives me the correct values, but i > cant addre

Re: [Rails] how do i loop through children?

2010-05-09 Thread Colin Law
On 9 May 2010 02:17, tom wrote: > hi, im having a model called category (polymorohic) and listing it in > the index-view: > >   >    Title engl >   > >  <% @categories.each do |category| %> >     >      <%= link_to h(category.title_engl), category %> >        - #of Subcategories: <%=h category.ch