[Rails] Re: Grab only the latest comment

2009-08-26 Thread Eric

http://api.rubyonrails.org/classes/ActiveRecord/Base.html

On Aug 26, 6:25 pm, gkrdvl  wrote:
> Hi all
>
> In a typical User - Post - Comment model in Rails, every user can
> create a Post and also can create Comment, question is how to grab
> every user latest comment on specific post.
>
> Example:
>
> Post A have 3 user making comment
> User 1 have 5 comment
> User 2 have 6 comment
> User 3 have 2 comment
>
> So the view I want is just the latest comment for every user:
>
> Post A have 3 user making
> User 1 latest comment
> User 2 latest comment
> user 3 latest comment
>
> How to do it ?
>
> 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: FULL TIME RoR POSITION- SEATTLE, WA

2009-08-24 Thread Eric

Though you don't list it as a starred requirement, the wording
suggests that you may want to refer to the following document before
composing future job reqs:

http://www.eeoc.gov/policy/docs/religion.html

On Aug 24, 10:56 am, Jake  wrote:
> We are seeking a Ruby on Rails Developer for a Full Time Position in
> Seattle.
>
> Our Client is seeking a highly qualified developer that is comfortable
> working within the agile methodology, and loves the Seattle area.
>
> The Developer will work with the rest of the development team to help
> create our Christian community networking web application.
>
> The candidate needs to be self-motivated, excited about the Christian
> community, and eager to be hands-on in the code for a majority of
> their days.
>
> Requirements
>
> *5+ years of software development experience.
> *Strong Experience with Ruby on Rails, MySQL OR C#/asp.net/vb.net with
> MVC framework OR PHP with one of the following frameworks; Symfony,
> Solar, CakePHP, CodeIgniter/Kohana, and/Or Zend Framework
> *Strong knowledge of software engineering and proven experience
> utilizing Facebook in web applications a plus.
> *B.A./B.S.Computer Science or related field of study.
>
> This position is full time, on site position in our Seattle offices.
--~--~-~--~~~---~--~~
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: Authlogic Forgot Password

2009-08-24 Thread Eric

Apropos to this, it's good to at least attempt to plug your subject
line into Google.

On Aug 24, 2:36 am, Abhishek shukla  wrote:
> http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-a...
> this might help u
>
> regards
> abhis
>
> On Mon, Aug 24, 2009 at 9:14 AM, tispratik  wrote:
>
> > Hi,
>
> > Has anyone implemented the Authlogic forgot password stuff?
> > Please let us know how to, if anyone has or has the code for it.
>
> > Thanks,
> > Pratik
>
>
--~--~-~--~~~---~--~~
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: Building a social Networking site...

2009-08-22 Thread Eric

On Aug 21, 8:33 am, RubyonRails_newbie 
wrote:
> Hi everyone.
>
> I’m looking to build a social networking type site in Ruby on Rails.
>
> I’m running on ruby 1.8.7, and have noticed there is a tutorial
> available called ‘’RailSpace’’.
>
> What I needed to know is, has anyone encountered any problems that
> stops them from following this tutorial on this version? as i see that
> railspace was written for an earlier audience, running 1.2.1/
>
> Or– is there a better tutorial out there for what I want to achieve?
>
> Cheers

I'm a little confused as to why you would need a social-network-
specific tutorial. Social networks are basically just accounts,
friends and messages, filling out features as you like, no? These all
involve basic programming concepts that you should learn anyway, and
there's plenty of information on the internet about each element.

-eric
--~--~-~--~~~---~--~~
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: What to do before launching v1.0?

2009-08-22 Thread Eric

rsync is a good place to start.

On Aug 22, 2:01 pm, bingo bob 
wrote:
> always seems to come back to testing (which I keep trying and failing to
> grasp).
>
> Thanks though - noted.
>
> I pretty much got backups sorted today with this rake task, ideal
>
> http://github.com/eichert12/mysql_tasks/tree/master
>
> I setup a cron job to run that task daily.
>
> Just need to make sure I also setup some sort of job to SCP or FTP or
> EMAIL or whatever and get those backup files off the server and
> somewhere else, anyone any tips?
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Starter DB's (general web app question) Where to get them?

2009-08-19 Thread Eric

On Aug 19, 7:28 pm, Philip Hallstrom  wrote:
> > I was wondering where people scrape information for the beginning of
> > production db's for particular things.
>
> > Like if I wanted to have a website related to cars. Someones isn't
> > actually entering in every vehicle type manually theres got to be a
> > solid method of finding that data somewhere that you can transform
> > into what you need?
>
> > Any hint/tricks for this?
>
> Google.
>
> http://www.google.com/search?q=car+make+model+database
>
> Looks like there are a couple of companies that make this information  
> available.
>
> You might also find the government has basic information (census type  
> stuff maybe), but most of the time you're probably going to end up  
> paying someone else for it.
>
> -philip

Indeed, this is market research data and it is an industry unto
itself. The less detail you want, the cheaper it will be, and beyond
some level of detail you are getting into proprietary models which
typically require money, licensing, equity, or all three.

-eric

-eric
--~--~-~--~~~---~--~~
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: CDN for Rails - any recommendations?

2009-08-09 Thread Eric

They should all be pretty much the same, requiring only certain URL
prefixes for your content. You may have to randomize hostnames if you
go with one that allocates blocks of nodes, but that's about it.

-eric

On Aug 9, 3:10 pm, Alpha Blue 
wrote:
> Are there any good recommendations for CDN's (Content Delivery Networks)
> for use with Rails?  I was looking at Amazon Cloudfront but am just
> curious if anyone has used CDNs with rails and whether or not you find a
> particular one more useful than the other.
>
> Many thanks.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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 partial doesn't work ?

2009-08-09 Thread Eric

On Aug 8, 4:08 pm, Philip Gavrilos 
wrote:
> jhaagmans wrote:
> > In your partial, you use the variable post. But post doesn't exist. At
> > least not as far as I can see. You've sent along a variable @posts and
> > you will probably have to use that in some kind of for loop.
>
> > For example:
> > <% for post in @posts do %>
> >   <% div_for post do %>
> >     <%= link_to_unless_current h(post.title), post %>
> >     <%= truncate(post.body, :length => 300) %> 
> >   <% end %>
> > <% end %>
>
> > Hope this helps!
>
> > Jaap Haagmans
> > w.http://www.relywebsolutions.nl
>
> > On 9 aug, 00:12, Philip Gavrilos 
>
> THANK YOU! THANK YOU! THANK YOU!   WORKS FINE!
>
> i did not understand my error here its because im newbie in ruby ( :P )
> (if _preview was _post everything was fine.. i think that is because
> naming conventions right?)

It worked with _post because Rails creates an object for the partial
with the same name as the partial filename. Since you were using
post.body, etc. in the partial, Rails picked up the post object and
displayed everything normally. This broke when you named the partial
'preview' because you were still using post.body, etc. When you use
_preview as the partial's filename you also need to change the lines
in the partial itself to preview.body, etc. in order for it to work.

Furthermore, you can change your instance variable to @previews and
do:

render :partial => @previews

and Rails will look for a posts/_preview.html.erb file, create a
'preview' variable for each element of the @previews object, which can
then be used with same preview.body, etc. syntax in the _preview
partial as outlined above.

TIMTOWTDI, natch, but I think this all is pretty close to what you're
asking about.

-eric

--~--~-~--~~~---~--~~
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: using a link conditionally in the view

2009-08-05 Thread Eric

one way:

link_to(obj.status_name, #{obj.status}_path)

this would require any extra routes to be added, as well as a
status_name attribute/model to supply the text.


On Aug 5, 2:31 pm, Brad  wrote:
> I want to render a different link_to name and url path based on an
> objects "status" attribute in the index view.  Would love to know how
> to get the logic out of the view, but barring that, when I use if/else
> statements in erb I can only render 4 different link options.
> Likewise, case/when is only allowing me to show 2 different results?
> Not sure what I am doing wrong (except I am sure I am putting way too
> much logic in the view).
>
> Any help or guidelines would be much appreciated.
--~--~-~--~~~---~--~~
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: NoMethodError in User sessionsController#create - Authlogic

2009-08-02 Thread Eric

I wrote an app today that used authlogic 2.1.1 on ruby 1.8.6 just
fine.

-eric

On Aug 2, 8:04 pm, ado  wrote:
> Hi, I had the same issue - I think it has something to do with the
> latest version of Authlogic possibly requiring Ruby 1.9???, whereas
> I'm running 1.8.6 on my dev machine and I see you're running 1.8.7.
>
> The commit 53834196c8f82cac6b105126e3d267246b7b2b67 from July 2, 2009
> seems to be the issue:
> Use mb_chars when downcasing login to deal with international
> characters
>
> Specifying the previous gem version in my Rails environment seemed to
> do the trick:
> config.gem 'authlogic', :version => "= 2.1.0"
>
> Let me know how it goes.
>
> On Aug 3, 4:34 am, "Rzepak G." 
> wrote:
>
>
>
> > vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:121:in
> > `find_with_case'
> > vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:110:in
> > `find_by_smart_case_login_field'
> > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in `send'
> > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in
> > `search_for_record'
> > vendor/rails/activerecord/lib/active_record/base.rb:1852:in `with_scope'
> > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in `send'
> > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in
> > `search_for_record'
> > vendor/plugins/authlogic/lib/authlogic/session/password.rb:178:in
> > `validate_by_password'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `send'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in
> > `evaluate_method'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:161:in `call'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
> > vendor/rails/activesupport/lib/active_support/callbacks.rb:272:in
> > `run_callbacks'
> > vendor/plugins/authlogic/lib/authlogic/session/callbacks.rb:71:in
> > `validate'
> > vendor/plugins/authlogic/lib/authlogic/session/validation.rb:62:in
> > `valid?'
> > vendor/plugins/authlogic/lib/authlogic/session/existence.rb:65:in `save'
> > app/controllers/user_sessions_controller.rb:8:in `create'
> > --
> > Posted viahttp://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: How to upload video to my Flash Media Server ?

2009-08-02 Thread Eric

On Aug 2, 3:03 pm, Erwin  wrote:
> I have an FMS (influxis) ready for video streaming
> I wonder how Y can transfer the video uploaded by my web app users
> into the FMS ? no plugin yet I guess.. should I use a js library ? all
> I have seen until now is via an AS3 ? how rails can I handle it with
> Rails ?
>
> thanks for your suggestions
>
> erwin

Just write it yourself. I'm not sure what javascript is supposed to
help with there, but use whatever you like.
--~--~-~--~~~---~--~~
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: Missing mislav-will_paginate - *SOLVED*

2009-08-02 Thread Eric

On Aug 2, 10:22 am, Michael Satterwhite  wrote:
> > Check outhttp://www.rubygems.org/read/chapter/1for details on what's
> > going on here.
>
> It's working now. Thanks to all who helped. I especially appreciate the
> reference. While the help is great - and go me going - knowledge is
> going to help me not have to ask dumb questions.
>
> Thanks again
> --
> Posted viahttp://www.ruby-forum.com/.

Just to be clear, your ":version => '~> x.x.x'" clause that you
removed had an actual version number and not x's, right?
--~--~-~--~~~---~--~~
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: NoMethodError in User sessionsController#create - Authlogic

2009-08-02 Thread Eric

On Aug 2, 11:14 am, "Rzepak G." 
wrote:
> it's just
> user_sessions - new.html.erb
> <% title "Login" %>
>
> <% form_for @user_session do |f| %>
>   <%= f.error_messages %>
>   
>     <%= f.label :username %>
>     <%= f.text_field :username %>
>   
>   
>     <%= f.label :password %>
>     <%= f.password_field :password %>
>   
>   <%= f.submit "Submit" %>
> <% end %>
>
> and it was created automatically.. i didn't change to much in code..
> --
> Posted viahttp://www.ruby-forum.com/.

OK, but do you see anything strange about:

"User sessionsController"?
--~--~-~--~~~---~--~~
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: NoMethodError in User sessionsController#create - Authlogic

2009-08-02 Thread Eric

On Aug 2, 10:01 am, "Rzepak G." 
wrote:
> Hi,
> I'm beginner in rails, and I wanted to add to my simple application
> Authlogic. So I've watchedhttp://railscasts.com/episodes/160-authlogic
> and step-by-step done everything. And almost everything works fine,
> except login in. After registration new user is automatically logged in,
> he can edit his profile, but after clicking logout and trying to login
> again I get error
>
> NoMethodError in User sessionsController#create
>
> undefined method `mb_chars' for "rzepak":String
>
> My user_session_controller.rb:
>
> class UserSessionsController < ApplicationController
>   def new
>     @user_session = UserSession.new
>   end
>
> def create
>   @user_session = UserSession.new(params[:user_session])
>   if @user_session.save
>     flash[:notice] = "Successfully logged in."
>     redirect_to root_url
>   else
>     render :action => 'new'
>   end
> end
>
> def destroy
>   current_user_session.destroy
>   flash[:notice] = "Successfully logged out."
>   redirect_to root_url
> end
>
> end
>
> I was trying to google this error, but with no success, so I hope I will
> find some help here
>
> gem -v 1.3.5
> ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]

You didn't post your view, but, maybe a typo via "User
sessionsController"?
--~--~-~--~~~---~--~~
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: belongs_:to association

2009-07-28 Thread Eric

On Jul 28, 10:34 am, cocozz  wrote:
> class Shopcategory0 < ActiveRecord::Base
>   set_table_name "shopcategories_0"
>
>   has_many   :shopcategory1s, :foreign_key => :parentcategory_id
> end
>
> class Shopcategory1 < ActiveRecord::Base
>   set_table_name "shopcategories_1"
>
>   belongs_to :shopcategory0, :foreign_key => :shopcategory_id
> end
>
> class Shopcategory0sController < ApplicationController
>   def show
>     @shopcategory = Shopcategory0.all (:joins
> =>  :shopcategory1s)
>   end
> end
>
> -
> That's the SQL result:
> -
>
> Shopcategory0 Load (0.1ms)   SELECT `shopcategories_0`.* FROM
> `shopcategories_0` INNER JOIN `shopcategories_1` ON
> shopcategories_1.parentcategory_id = shopcategories_0.id
>
> -
> And this is what I search (notice the end):
> -
>
> Shopcategory0 Load (0.1ms)   SELECT `shopcategories_0`.* FROM
> `shopcategories_0` INNER JOIN `shopcategories_1` ON
> shopcategories_1.parentcategory_id = shopcategories_0.shopcategory_id
>
> I suppose there is a way to do that...I'll appreciate your help !!!

Is there a question in there?

-e
--~--~-~--~~~---~--~~
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: Google Calendar

2009-07-26 Thread Eric

On Jul 26, 4:58 am, Abhishek shukla  wrote:
> Hello Friends,
> I am looking out for the same functionality like Google calendar like by
> selecting the start date and end date by dragging a mouse. Can anyone help
> me out with the example or sample code.

No. What you seek will be a combination of technique, knowledge, and
probably more than a few plugins/gems. There is no "instant Google
Calendar," but if you have specific questions we can help with those.

-e
--~--~-~--~~~---~--~~
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: my first app with RoR problem.

2009-07-20 Thread Eric

On Jul 20, 7:08 pm, Renzo  wrote:

>   no such file to load -- sqlite3

Install sqlite3.

-eric
--~--~-~--~~~---~--~~
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: Project Code Decision

2009-07-20 Thread Eric

Thanks Bill.

On Jul 20, 6:23 pm, bill walton  wrote:
> Hi Eric
>
> On Mon, 2009-07-20 at 08:28 -0700, Eric wrote:
> > I know I will be developing the site itself with rails.  
>
> Super.
>
> > However I am not sure how well rails will work for the
> > actual simulation.  My question is do you all think that
> > rails would be a good tool for creating the sim or should
> > I stick to PHP?  
>
> Rails is a framework for creating database-driven, web-based
> applications in Ruby.  Your sim question should be Ruby vs. PHP, not
> Rails vs. PHP.  You might want to ask it on the Ruby-talk mailing
> list.  
>
> The one thing you can count on is that a Ruby-based sim is going to be a
> more natural fit for integrating with Rails than a PHP-based sim.  Other
> than that, your existing skill-set, and willingness to learn something
> new (i.e., Ruby), I'd think the nature of the sim itself is probably the
> most important factor WRT to the Ruby vs. PHP question  Ruby is very OO.
>
> HTH,
> Bil
--~--~-~--~~~---~--~~
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] Project Code Decision

2009-07-20 Thread Eric

Hello Everyone,

My name is Eric.  I will be starting a large project soon and I have a
few questions.  I will be creating a browser based sports simulator.
Users will be able to create a player or a coach and ether coach a
team or play on a team.  We plan to have features like a live game
tracker, mini pickup games, and multiple player and team managements.
I know I will be developing the site itself with rails.  However I am
not sure how well rails will work for the actual simulation.  My
question is do you all think that rails would be a good tool for
creating the sim or should I stick to PHP?  I expect to get mostly
bias answers here due to the fact that this is the rails communality,
but I would love if someone who has had experience with both can give
me a few reasons why one would be better than the other.  Thanks for
your time.

Eric

--~--~-~--~~~---~--~~
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] hello

2009-07-20 Thread eric

Hello everyone this is my first post. I come from a .NET background
but I have seen first hand the elegance of ruby and now i'm hooked.
I'm learning rails on 2.3.x and have worked through setting up a db
connection and building scaffolding, i'm excited and needed a place to
land once and a while to discuss things as I stumble through the dark.

Thanks for taking a minute to listen, I hope to be participating
instead of just leaching very soon.

--~--~-~--~~~---~--~~
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: Using multiple SMTP servers with Rails - avoiding blacklisting

2009-07-16 Thread Eric

> Anyone else run into these issues and found a good solution?

Yes, get a real ISP. It'll be much simpler than the kludge you're
proposing. An alternative would be a hire a competent sysadmin to set
up your own SMTP server and antispam DNS records.

-eric
--~--~-~--~~~---~--~~
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: Problem with routes.rb in rails 2.3.2

2009-07-15 Thread Eric

On Jul 15, 5:45 pm, sultan  wrote:
> Problem with routes.rb in rails 2.3.2:
>
> The problems occurs if the rails version is "frozen" or not. I get the
> same problem when the routes are present in the routes.rb file.
>
> In order to try to figure out the problem, I commented out all the
> routes in routes.rb, so the following are the only two statements in
> routes.rb:
>
> ActionController::Routing::Routes.draw do |map|
>
> end
>
> When I run
>
> “# rake routes –trace”
>
> I get:

Why are you even trying that? Don't.

-eric
--~--~-~--~~~---~--~~
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: Working Depot app? (not AWDWR-related)

2009-07-15 Thread Eric

On Jul 15, 12:39 am, Felix Schäfer  wrote:
> Am 15.07.2009 um 05:26 schrieb Marnen Laibow-Koser:
>
> > Felix Schäfer wrote:
> >> Am 14.07.2009 um 21:35 schrieb
> >> lph Bl :
> >>http://www.netbeans.org/kb/samples/ruby-depot.html
>
> >> That's the code from AWDWR (Agile Web Development with Rails), and a)
> >> I don't want to dl and install netbeans just to get the code,
>
> > I don't think you have to.
>
> Well, at least if I want it from the netbeans website :-)
>
> >> b) I am
> >> a little weary of code marked as "sample", but thanks anyway :-)
>
> > (Note: "weary" = "tired".  "Wary" = "cautious", which is what I assume
> > you meant.)
>
> I meant wary, but it seems I was a little weary when I wrote it *coughs*
>
> > With a request such as your original post, probably all you're going  
> > to
> > get is samples.  If you can be a bit more specific about what you want
> > and why you want it, perhaps you'll get better answers...
>
> Ok, specific use case here: we're planning a reunion with all past and  
> present members of a choir I sing in, because the choirmasters have  
> been leading this choir for the last 20 years, and we're trying to get  
> as much photographs and stuff together to make a nice collage/art/
> whatever. The depot would enable people to upload stuff to it that is  
> too big for mails, but too small for some sort of "burn it on a DVD  
> and send it per snailmail" scheme.
>
> Anyway, the depot should:
> - just work (which is why I'm wary of a "sample app", I don't have the  
> time to look over something in case it doesn't work),
> - not require any sort of registration or one-time key or anything,  
> because it won't run longer than 6 weeks, and it should be more of a  
> one-off thing for the users,
> - be simple, as in dead simple, because most of those people are at  
> best "dumb" users.

Paperclip (or attachment_fu, etc.) "just works," so you can make an
app with one controller and a page with a single form field with a
file selector and let your people loose on it. Other than that, I
can't think of any more on-topic help I can offer.

--~--~-~--~~~---~--~~
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: Basics of Capistrano

2009-07-15 Thread Eric

On Jul 15, 12:14 am, Pål Bergström 
wrote:
> I'm searching the net but about Capistrano, but can't get a complete
> understanding. Could someone please give me some small hints :)
>
> I have local developer environment, using git. The remote server also
> has git and I have the app in root. Today I use ftp. What should I do
> when I just want to send the files that are different, letting my local
> app decide that, and how does the deploy.rb look like?

http://www.google.com/#hl=en&q=capistrano+tutorial

First link should be fine.
--~--~-~--~~~---~--~~
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: How to check if a table is empty ?

2009-07-12 Thread Eric



On Jul 12, 10:19 am, "Älphä Blüë" 
wrote:
> > But the variable is unnecessary, and in fact, a more concise way of
> > saying the same thing would be
>
> > if Model.find(:all).empty?
>
> Agreed.  I was just showing that there are more ways of doing things.  I
> use your approach...
>
> .empty?
> .nil?
>
> .. two things I use heavily in my projects...

Typically I use something like 'unless Model.first', but are any of
these techniques particularly lighter/faster on the db than others?

-eric
--~--~-~--~~~---~--~~
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: Storing Images in Database or File System?

2009-07-10 Thread Eric

Storing in the filesystem avoids database and app overhead, while also
allowing files to be moved to a different server if desired.

As for Imagemagick and rMagick and Rails, the IM part is simply to
install it and make sure your PATH includes IM's bin directory, as the
conversion process is pretty much just a system call to the `convert`
utility.

-eric

On Jul 10, 11:18 am, SS  wrote:
> Thank you all for your responses. What I'm trying to achieve is
> allowing users to post their photos
> on the website and give them ability to search for photos of others.
> Therefore, I'm dealing with large
> number of files, not so much with large size of files.
>
> Arzumy, you mentioned the Paperclip library. I've been looking into
> integrating it with my Rails code
> to do most of the image management. I installed the latest ImageMagick
> version on Windows Vista, however I keep
> getting problems. The ImageMagick installed correctly, the problem is
> after I tried to submit my Rails form with
> a .jpg or .gif photo it gives me the error:
>
> "Photo C:/Users/.../AppData/Local/Temp/stream.1556.0 is not recognized
> by the 'identify' command."
>
> I read that I get this error message, because I need to install
> dependency such as delegates for each file type
> allowed to be processed, i.e. jpeg, by ImageMagick but all of the
> articles that I came across they are not clear and
> straight to the point how to install and configure those delegates on
> Win Vista. I believe that you have
> ImageMagick running on your machine and I was hoping that you can
> direct me to a good resource
> on how to get it working with Rails.
>
> I would greatly appreciate any recommendations!
>
> SS
>
> On Jul 8, 12:46 pm, Arzumy  wrote:
>
> > May I add that by storing your images in on filesystem within public
> > will allow any request to bypass your app server and serve directly by
> > web server. And lessdatabasehit, means faster response time :)
>
> > Strongly suggest don't store indatabase, if later on you want to
> > manipulate the images using external application, you can do it easily
> > if everything on filesystem. And using paperclip for example, allows
> > you to store multiple copies of the images in different sizes, created
> > immediately after upload.
>
> > But yeah, if you could provide more info on what you want to achieve,
> > the implementation could differ :)
>
> > Cheers!
> > Arzumy
>
> > On Jul 8, 10:47 pm, Roderick van Domburg 
> > s.net> wrote:
> > > Exactly what does "large image content" mean? Are they large images, or
> > > will you have a large amount of images? Is the typical workload
> > > characterized by read operations or write operations? Do some of the
> > > images require access authorization?
>
> > > Reading from the filesystem is faster than from thedatabase. What's
> > > best for you depends on your specific situation.
>
> > > --
> > > Roderick van Domburghttp://www.nedforce.com
> > > --
> > > Posted viahttp://www.ruby-forum.com/.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Different version of RoR on server

2009-07-08 Thread Eric

On Jul 8, 3:24 pm, Pål Bergström 
wrote:
> Eric wrote:
> > On Jul 8, 2:15 pm, P l Bergstr m 
> > wrote:
> >> I use rails 2.3.2. The server use 2.1.1. What do I do? Make a new app on
> >> my side based on 2.1.1? If yes, how do I do that?
>
> > The long way would be to install 2.1.1 via "gem install rails -v
> > 2.1.1" and change the Rails version for the app in config/
> > environment.rb.
>
> Thanks. I think I'll do that. Can change that in environment.rb without
> making any other changes, considering the app is done for 2.3.2?

You will probably have to make other changes too, depending on how the
app itself is written.

-eric
--~--~-~--~~~---~--~~
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: Different version of RoR on server

2009-07-08 Thread Eric

On Jul 8, 2:15 pm, Pål Bergström 
wrote:
> I use rails 2.3.2. The server use 2.1.1. What do I do? Make a new app on
> my side based on 2.1.1? If yes, how do I do that?

The long way would be to install 2.1.1 via "gem install rails -v
2.1.1" and change the Rails version for the app in config/
environment.rb.
--~--~-~--~~~---~--~~
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] Senior Ror,Mysql

2009-07-08 Thread eric cs

We are looking for experienced Ruby on Rails, Mysql, Ajax, Padrones de
diseno,uml,CSS desarrollador de un proyecto completo.

El proyecto se llevaría a cabo a través de Internet, 8-9 horas al día
durante un mes por lo menos.
Por favor envíe su CV y aspiraciones salariales.
projetoec...@hotmail.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: has_many relationship - specify how quantity (how many)

2009-07-05 Thread Eric

validates :bar_limit

def bar_limit
  ...
end

-eric

On Jul 5, 2:12 pm, Michal Burak 
wrote:
> Hi,
>
> Is there any way to specify a a validation rule or something for the
> "has_many' relationship so that it would count the related objects?
>
> For e.g. I want my Foo object to have maximum of 5 Bar objects in
> has_many relationship.
>
> M.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Creating a Hierarchical View

2009-07-01 Thread Eric

> different ways of doing essentially the same thing.  Both could be
> helpful in creating a hierarchical view but neither provides a slam-
> dunk approach to that end.

Rails still requires "programming," after all. Are you having trouble
creating an unordered list in your view or something?

-e
--~--~-~--~~~---~--~~
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: First application: Alternatives to creating a database?

2009-06-28 Thread Eric Vernon

Many thanks, that did it for me!

Cheers.

On Jun 27, 7:19 am, "Simon Macneall"  wrote:
> Hi,
>
> I assume you have set up your database.yml file correctly, then just  
> create the db manually using using the webpanel, and then run rake  
> db:migrate to create all your tables.
>
> Simon
>
> On Sat, 27 Jun 2009 06:55:54 +0800, wolfbyt...@gmail.com  
>
>  wrote:
>
> > Hi,
>
> > I've done a bit of web development work, but decided to try something
> > new after I got into a fight with PHP over regular expressions.  I
> > figured I'd have nothing to do by trying out Rails, so here I am.
>
> > I'm following along the getting started guide:
> >http://guides.rubyonrails.org/getting_started.html
>
> > However, I just hit my first snag.  "rake db:create" is returning the
> > error "Couldn't create the database for... etc.".  I get the
> > impression that this will attempt to create the database, which would
> > explain the error: With my webhost, the database users aren't allowed
> > to create new databases; that needs to be done from the web panel.
>
> > How can I -connect- to a (remote) database and build the needed
> > tables, but not -create- an entirely new database?  Thanks, I
> > appreciate it.
>
> > Eric
--~--~-~--~~~---~--~~
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: Help: Webmonkey's Rails example NOT working on Bluehost

2009-06-27 Thread Eric

Sounds like it's a problem with Bluehost's documentation, have you
tried asking them about it?

-eric

On Jun 27, 7:59 am, GuruOne  wrote:
> Dear Tom,
>
> Thxs for the links to the bluehost articles.
>
> I followed and executed step by step article '000207' without any
> hitches.
>
> I also followed and executed step by step article '000493' to try to
> eliminate the '404 Not Found' error BUT still getting it.
>
> Any ideas / pointers on how to fix?
>
> Regards
> On Jun 26, 4:29 pm, merft  wrote:
>
> > Just set up on Bluehost a test ruby project by using their tutorials.
>
> >http://helpdesk.bluehost.com/index.php/kb/article/000207
>
> > You will also need to enable FCGI explained at:
>
> >http://helpdesk.bluehost.com/index.php/kb/article/000493
>
> > -Tom
>
> > On Jun 26, 11:38 am, GuruOne  wrote:
>
> > > I need some help in getting my first Rails application going.
> > > Operating environment background
> > > - Hosting Provider: Bluehost
> > > - ruby, rails, apache: all ok and ready to go. I have written many
> > > ruby programs in this environment which all work.
> > > - Browsers used for testing: Chrome, IE
> > > - MySQL: I have many Databases up and running in this environment
>
> > > Rails example being 
> > > used:http://www.webmonkey.com/tutorial/Ruby_on_Rails_for_Beginners
>
> > > Step1: Created MySQL database and table per the Webmonkey spec - I
> > > actually added 1 extra column to the table.
>
> > > Step2:
> > > Create starter framework:
> > > rails Bookmarker
> > > cd Bookmarker
>
> > > Edit 'config/database.yml' and modified 1st stanza with database just
> > > created
>
> > > Generate component components of application:
> > > ruby ./script/generate scaffold Bookmark
>
> > > OK SO FAR. I really want to use the Apache Web Server (already
> > > installed and available) instead of WEBrick but to keep things simple
> > > I will stick with WEBRICK
>
> > > Start WEBrick server:
> > > ruby ./script/server # Starts successfully
>
> > > Try to access using Chrome (which works on all other websites I have
> > > in my account) 
> > > withhttps://www.datajazz.com:3000/bookmarks#Didn'tworkhttps://www.datajazz.com:3000/BDsrc/Bookmarker/bookmarks#Didn'twork
>
> > > I am going to assume the reason for the failure is because WEBrick
> > > must be behind a firewall i.e. Bluehost's.
>
> > > Help needed
> > > 1. Resolve the above issue
> > > 2. Switch from the WEBrick to Apache server
>
> > > Please help!.
>
> > > Regards
>
>
--~--~-~--~~~---~--~~
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: has_many:through

2009-06-27 Thread Eric

remove the .find(:all), you've already found @team so
@team.rushing_offenses is all you need.

-eric

On Jun 27, 8:24 am, "Älphä Blüë" 
wrote:
> Hrm, okay my tables are setup correctly now and populated so I'm trying
> to do a find, but I must be doing it wrong..
>
> class Team < ActiveRecord::Base
>   has_many  :rushing_offenses
> end
>
> class RushingOffense < ActiveRecord::Base
>   belongs_to  :team
> end
>
> I've tried the following in the rails console:
>
> @team = Team.find(:all)
> @rushing_offenses = @team.rushing_offenses.find(:all)
>
> and get an undefined method rushing_offenses error
>
> Again, I'm probably doing this wrong.  Let me break it apart the way I
> believe it's reading from a code standpoint:
>
> @team = Team.find(:all)
> --> Is finding all the data in the teams table
>
> @rushing_offenses = @team.rushing_offenses.find(:all)
> --> assign an instance variable @rushing_offenses
> --> utilize the associations with: @team found all data in teams
> --> utilize the associations with: rushing_offenses (because it belongs
> to team)
> --> rushing_offenses.find(:all) would find all data in the
> rushing_offenses table
>
> Yes?.. No?..
>
> I read up on the associations and understand the association thinking
> and when to use associations.  I just don't understand the code syntax
> between them and how to use the code syntax for normal querying...
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: How can I contribute with http://api.rubyonrails.org/ ?

2009-06-23 Thread Eric Fer

Hi Frederick.
Thanks very much for the tip about docrails ;)



On Jun 22, 4:35 am, Frederick Cheung 
wrote:
> On Jun 22, 2:53 am, pharrington  wrote:
>
>
>
> > > On Jun 21, 9:12 pm,Eric Fer wrote:
> > > Hi everyone.
> > > I was looking for a helper definition (create_table) and I've noticed
> > > that the documentation inhttp://api.rubyonrails.org/isincomplete.
> > > It's not covering the "sexy migration" options to defining the columns
> > > like "t.string :name". It's just showing "t.column :name, :string"
> > > way.
>
> > > There is a note about this "sexy" way of create tables 
> > > inhttp://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatem...
>
> > > Actually my question is: how can I contribute with updates and changes
> > > like that inhttp://api.rubyonrails.org/?
>
> > > Thank you all !!
>
> > BUT either way since that's basically just the rdoc output,
> > contributing to the documentation is the same as contributing to Rails
> > itself (except you're adding comments instead of code :) )
>
> True, but the docrails fork of rails (http://wiki.github.com/lifo/
> docrails) is setup specifically for contributions to documentation
> (since the usual patch workflow is a bit overkill for just
> documentation changes).
>
> 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
-~--~~~~--~~--~--~---



[Rails] Re: How can I contribute with http://api.rubyonrails.org/ ?

2009-06-23 Thread Eric Fer

Hi pharrington !!!
Thanks for your reply :)
It's very true this is the doc that I was looking for.
The unfortune is that when I look for "create_table", the link is
this: 
http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#M002191

Again, thanks a lot :)

On Jun 21, 10:48 pm, pharrington  wrote:
> > On Jun 21, 9:12 pm,Eric Fer wrote:
> > Hi everyone.
> > I was looking for a helper definition (create_table) and I've noticed
> > that the documentation inhttp://api.rubyonrails.org/isincomplete.
> > It's not covering the "sexy migration" options to defining the columns
> > like "t.string :name". It's just showing "t.column :name, :string"
> > way.
>
> > There is a note about this "sexy" way of create tables 
> > inhttp://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatem...
>
> > Actually my question is: how can I contribute with updates and changes
> > like that inhttp://api.rubyonrails.org/?
>
> > Thank you all !!
>
> The second example shows 
> this:http://api.rubyonrails.org/classes/ActiveRecord/Migration.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] How can I contribute with http://api.rubyonrails.org/ ?

2009-06-21 Thread Eric Fer

Hi everyone.
I was looking for a helper definition (create_table) and I've noticed
that the documentation in http://api.rubyonrails.org/ is incomplete.
It's not covering the "sexy migration" options to defining the columns
like "t.string :name". It's just showing "t.column :name, :string"
way.

There is a note about this "sexy" way of create tables in
http://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatements/create_table

Actually my question is: how can I contribute with updates and changes
like that in http://api.rubyonrails.org/ ?

Thank you all !!



--~--~-~--~~~---~--~~
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 with has_many :through and habtm

2009-06-21 Thread Eric

What are the associations for the Trim model, wrt Options and
Vehicles? I'm also assuming that the NewVehicle model is a typo and
it's supposed to be just Vehicle.new in the snippet.

I'm thinking that you need either uniqueness validations or to dedupe
manually in your save/updates, but it's hard to tell so far.

-eric

On Jun 21, 8:29 am, erik  wrote:
> I'm in Rails 2.2.2 if that matters.
> Erik
>
> On Jun 21, 8:27 am, erik  wrote:
>
> > I don't follow you.
>
> > I find all the options based on the idea of a trim (a style).  Think
> > about how a honda civic ex might have different options then a honda
> > civic lx.  In the real app you would only select a subset of those
> > options to assign to your vehicle.  Vehicle is kind of like an
> > instance of a Trim, but it's different and has it's own model.  So I
> > am grabbing all the options by trim (options =
> > Option.find_all_by_trim_id(t.id)) and then assigning them to a vehicle
> > (v.options = options or v.options_ids = options_ids).
>
> > You are right I could of done t.options instead of
> > Option.find_all_by_trim_id, but I have tried both.  I replaced:
> > Option.find_all_by_trim_id with options = t.options and I have 47 in
> > the array of options, but 94 are saved, 2 each exactly.
>
> > It works fine if I do:
> > options.each {|o|
> >   OptionsVehicle.create({'option_id' => o.option_id, 'vehicle_id' =>
> > v.id})
>
> > }
>
> > and explicitly create the join table values.
>
> > I have confused rails...I guess.
> > Erik
>
> > On Jun 20, 11:40 pm, Eric  wrote:
>
> > > On Jun 20, 5:18 pm, erik  wrote:
>
> > > > I have tried this both ways and each time same results, duplicate
> > > > entries.
>
> > > > Here is the simple test:
> > > > t = Trim.find(:first, :conditions => ['id > 6500'])
> > > > options = Option.find_all_by_trim_id(t.id)
> > > > puts options.size
> > > > v = NewVehicle.new({:trim_id => t.id})
> > > > v.option_ids = options.map {|o| o.id}
> > > > v.save
>
> > > > I also tried it just with v.options = options, using option_ids was
> > > > just another attempt to make this work
>
> > > > The size of options in this case is 47.  options_vehicles which is my
> > > > join table will have 94 results exactly 2 of each one option.  So if
> > > > the option_id = 6 and vehicle_id is 4 i have 6,4 in the join table
> > > > twice.
>
> > > > I am doing one thing a little odd, but i have no idea what's causing
> > > > this issue.  My models look like this:
> > > > Option.rb
> > > >  set_primary_key "option_id"
> > > >   has_many        :options_vehicles
> > > >   has_many        :vehicles, :through => :options_vehicles
>
> > > > I have to use option_id as the primary key and it's a string.  This is
> > > > other data i'm importing and I can't change the way it's organzied.
>
> > > > Vehicle.rb
> > > >   has_many        :options_vehicles,
> > > >   has_many        :options, :through => :options_vehicles
>
> > > > My join table looks like a habtm table because it was.  I have tried
> > > > this both ways activerecord continues to put in dupes.
>
> > > > I actually went into the code at
> > > > /data/www/production/vendor/rails/activerecord/lib/active_record/
> > > > associations.rb:1392
> > > > and put prints in there and see it showing the size of the records to
> > > > save as 47, but it's going through here twice.
>
> > > > I have option_id in options marked as the primary key with a unique
> > > > index in mysql.
>
> > > > Any help would be appreciated I feel like I'm going crazy...
> > > > Erik
>
> > > You don't need to do the Options.find because you already have
> > > t.options. This may also explain the dupes.
>
> > > -eric
>
>
--~--~-~--~~~---~--~~
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 with has_many :through and habtm

2009-06-20 Thread Eric

On Jun 20, 5:18 pm, erik  wrote:
> I have tried this both ways and each time same results, duplicate
> entries.
>
> Here is the simple test:
> t = Trim.find(:first, :conditions => ['id > 6500'])
> options = Option.find_all_by_trim_id(t.id)
> puts options.size
> v = NewVehicle.new({:trim_id => t.id})
> v.option_ids = options.map {|o| o.id}
> v.save
>
> I also tried it just with v.options = options, using option_ids was
> just another attempt to make this work
>
> The size of options in this case is 47.  options_vehicles which is my
> join table will have 94 results exactly 2 of each one option.  So if
> the option_id = 6 and vehicle_id is 4 i have 6,4 in the join table
> twice.
>
> I am doing one thing a little odd, but i have no idea what's causing
> this issue.  My models look like this:
> Option.rb
>  set_primary_key "option_id"
>   has_many        :options_vehicles
>   has_many        :vehicles, :through => :options_vehicles
>
> I have to use option_id as the primary key and it's a string.  This is
> other data i'm importing and I can't change the way it's organzied.
>
> Vehicle.rb
>   has_many        :options_vehicles,
>   has_many        :options, :through => :options_vehicles
>
> My join table looks like a habtm table because it was.  I have tried
> this both ways activerecord continues to put in dupes.
>
> I actually went into the code at
> /data/www/production/vendor/rails/activerecord/lib/active_record/
> associations.rb:1392
> and put prints in there and see it showing the size of the records to
> save as 47, but it's going through here twice.
>
> I have option_id in options marked as the primary key with a unique
> index in mysql.
>
> Any help would be appreciated I feel like I'm going crazy...
> Erik

You don't need to do the Options.find because you already have
t.options. This may also explain the dupes.

-eric
--~--~-~--~~~---~--~~
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: Problem with calendar_date_select

2009-06-16 Thread Eric

On Jun 16, 10:24 am, Rafael Roque 
wrote:
> Anyone???

You know, sometimes it takes more than an hour for people to get to
your question.

It looks like either the gem isn't installed on your Tomcat server or
Tomcat is having trouble finding 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] BME-cat importer to db

2009-06-15 Thread Eric Carl

It's the first project for me on ruby on rails.
I want to write a XML importer to database. But i have several question
1)for my purpose of creating importer should I have an example file with
full-filled XML-data? (in the case creating all lines in the different
tables)
2) do you an example of XML-BME-cat file ?
3) do you have specification on english. (I have on German)
4) can you give me advice how to create database structure  in such
projects??(open specification and manually adding new line to each table
or there is another way?)

5) how do you solve such project step-by-step?
-- 
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: Transferring old RoR site.... Problems.... sigh...

2009-06-05 Thread Eric

On Jun 5, 4:47 pm, Rusty Rustybucket  wrote:
> > That's a really really old version of rubygems, but quite a new
> > version of mongrel. There used to be a method in rubygems called
> > require_gem, but later on that was renamed to just gem, which mongrel
> > is trying to call but which doesn't exist in your version of rubygems.
> > If you do update rubygems then you'll probably run into the fact that
> > your version of rails (or the boot.rb script in your app) is still
> > using require_gem, but require_gem was eventually removed from
> > rubygems. It should just be a matter of replacing calls to require_gem
> > with calls to gem.
>
> > Fred
>
> That's what I was thinking Anyone got a suggestion of what version
> of mongrel to try and run?
>
> Or possibly better, how do I determine what version of mongrel is
> running on the current server.

gem list mongrel --local

if you have more than one version installed, it'll be listed there.
easiest thing to do seems to be to just uninstall your latest version
that's giving you problems, then upgrading the app more gradually
later.
--~--~-~--~~~---~--~~
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: Logout link.....unless logging in!

2009-05-19 Thread Eric

adjust for authlogic:

if current_user.logged_in?
  # logout link
else
  # login/signup links
end

On May 19, 1:36 pm, JannaB  wrote:
> I have a link, /user_session/new, which takes you to a login screen (I
> am using AuthLogic plugin) and in my layout template I have
>
> 
>  <%= link_to "Logout", user_session_path, :method => :delete, :confirm
> => "Are you sure you want to logout?" %>
>         <%= @content_for_layout %>
>  
>
> How can I set this up so that if the url is for the login (i.e.  /
> user_session/new) the logout link does not show? Thanks, JannaB
--~--~-~--~~~---~--~~
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: save doesn't work in migration

2009-05-06 Thread Eric L.

Never mind, after some Googling, found reset_column_info to be my
answer.

On May 6, 10:18 pm, "Eric L."  wrote:
> I'm writing a migration to merge my first and last name fields into a
> single name field.  However, writing to the new name column doesn't
> work within the migration.  Why is this so?
>
> def self.up
>   add_column :users, :name, :string
>
>   for user in User.all
>     user.name = user.first_name + ' ' + user.last_name
>     user.save! # <= name is not actually saved here.
>   end
>
>   remove_column :users, :first_name
>   remove_column :users, :last_name
> end
--~--~-~--~~~---~--~~
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] save doesn't work in migration

2009-05-06 Thread Eric L.

I'm writing a migration to merge my first and last name fields into a
single name field.  However, writing to the new name column doesn't
work within the migration.  Why is this so?

def self.up
  add_column :users, :name, :string

  for user in User.all
user.name = user.first_name + ' ' + user.last_name
user.save! # <= name is not actually saved here.
  end

  remove_column :users, :first_name
  remove_column :users, :last_name
end


--~--~-~--~~~---~--~~
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] Question regarding has_one and association_build

2009-05-05 Thread Eric L.

In the doc, there's is a note saying association_build "only works if
an association already exists. It will NOT work if the association is
nil."  But in my test, it works fine when the association is nil.  For
example,

class Post < ActiveRecord::Base
  has_one :author

  def after_initialize
  build_author
  end
end

This works perfectly for me.  So is the warning in the doc something I
should be worried about?

Link to doc: 
http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#M001790

Thanks,
Eric
--~--~-~--~~~---~--~~
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: In lieu of scaffolding...

2009-05-03 Thread Eric

On May 3, 10:28 am, JannaB  wrote:
> I am wondering what you gentlemen might use in lieu of basic
> scaffolding. Suppose I have a simple table, and it has, say, 100,000
> rows. I want the user to be able to drill down to edit (and/or
> possibly delete) a given row, as well as to show him, say, a screen
> (or more) of potential candidate rowns that meet his criteria. Surely,
> there must be some widely used public domain code to do this?
>
> As an example, suppose I have a table of "people" and one of the
> fields is lastname. As I type in letters for the lastrname, the
> candidate rows that match that partial lastname begin to show, such
> that the user can select a single row to edit/delete. Is there some
> basic public domain code out for doing something along these lines?
>
> What do you gentlement use when you want scaffolding that is more than
> just the basic scaffolding for table editing like this? Thank you! -
> JannaB

I don't know about "public domain," but you'd probably want to look
into observers and in_place_edit. Besides that, it all sounds basic
enough.

-eric
--~--~-~--~~~---~--~~
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: Linking to RJS files from multiple locations

2009-05-02 Thread Eric

> <%= button_to_remote "Test", :url => {:controller => 'testcontroller',
> :action => 'test'} %>
>
> The RJS file is the same, just moved to the 'testcontroller' view
> directory.  This dosen't seem to be working, can anyone advise me as to
> what's going wrong?

Is the request even reaching the testcontroller?
--~--~-~--~~~---~--~~
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: Restful rails

2009-05-02 Thread Eric

On May 1, 5:03 pm, chaitanya  wrote:
> I have some questions regarding restful rails applications.
> Is the concept of restful so tied to the database ?
>
> What if a application does not use a database  at all  or if the
> application is using a legacy database which you cannot modify or does
> not have the concept of ids. How will restful urls and crud come into
> this picture.

REST has nothing to do with the database, it's just a convention
oriented around HTTP verbs and default actions associated with them.
That is, it's between a browser (or other client) and the controllers.

http://en.wikipedia.org/wiki/Representational_State_Transfer
--~--~-~--~~~---~--~~
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: Multiple models

2009-05-02 Thread Eric

> My problem is on however to have multiple models in one view. I was
> able to use form_tag togather data form all models except book. How
> could I get this resolved is my concern? I know that this is a new
> bie's kind of question, but I crave for your understand.

You'll want to look at fields_for. Watch the "Complex Forms" trilogy
of Railscasts from a couple years ago.

-eric
--~--~-~--~~~---~--~~
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: any way to submit an image as part of a form (Javascript?)

2009-05-02 Thread Eric

On May 2, 4:14 am, itsastickup  wrote:
> I would like to submit the data of a rendered image from the users
> browser in a form.

do you mean you'd like to allow users to upload images?

-eric
--~--~-~--~~~---~--~~
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] Creating & Validating w/ has_many :through

2009-04-27 Thread Eric Milford

I don't have a full grasp on has_many :through associations.  I've
detailed my models below and am trying to figure out how to do the
following in the proper manner.

1. Add the selected software (only one selectable) to the current
ticket.  I have @ticket.software << @software working just fine.
2. Validate that A) 1 or more systems have been selected, B) A
:software_status has been selected.  I'm not sure where these
validations should go.
3. Create the software to system association (w/ sofware_status value)
through the join model
4. How to setup the new/edit form to manage all of this.

Thanks in advance.

Ticket.rb

has_and_belongs_to_many :software

Software.rb

has_many :system_software
has_many :systems, :through => :system_software

System.rb

has_many :system_software
has_many :software, :through => :system_software

SystemSoftware.rb

belongs_to :system
belongs_to :software
belongs_to :software_status

SoftwareStatus.rb

has_many :system_software
-- 
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: plugin loading

2009-04-24 Thread Eric

On Apr 24, 1:22 pm, David Forman 
wrote:
> I just updated from Rails 1.2.0 to Rails 2.3.2 and none of the app
> plugins seem to load. The server starts without any problems, but none
> of the plugin code is available. Help!

That's a big jump, I'm betting you'll need to update the plugins
themselves, too.
--~--~-~--~~~---~--~~
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: Can u visit rubyonrails.org

2009-04-22 Thread Yves-Eric

It just looks like somebody forgot to renew the domain name.

Until this gets resolved, could someone please post here
the IP(s) of the rubyonrails.org server(s) so that we
can temporarily put them in our host files? Thank you.


--
Yves-Eric


On Apr 23, 1:23 pm, Phlip  wrote:
> Jack Zhan wrote:
> > When I visit rubyonrails.org, it comes up with an ads page. What's
> > wrong?
>
> It's been poached. The system sucks, as usual!
>
> --
>    Phlip
>    http://flea.sourceforge.net/resume.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] Resource-based routing and controller module

2009-04-22 Thread Eric L.

I have a Request resource in my application.  A "Request" is created
by users of the system, but managed by administrators.  For example,
user creates a request to fix a chair, and administrator views and
edits the request.  As a result, I want to create two Request
controllers: Admin::RequestsController and RequestsController.  The
latter is for users of the system to create requests, and lack the
view, update, and delete actions, which are in
Admin::RequestsController only.

My problem is regarding routing.  The simple "map.resources :requests"
declaration in routes.rb only generates routes for the user
RequestsController.  Is there a way to have it route POST requests to
the user RequestsController (with URL /requests), and route all other
requests (PUT, GET, etc.) to Admin::RequestsController (with URL /
admin/requests)?

Thanks,
Eric
--~--~-~--~~~---~--~~
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: attachment_fu giving problem on production

2009-04-21 Thread Eric

Is ImageMagick installed?

On Apr 21, 11:37 am, Abhishek shukla  wrote:
> Hello friends,
> I have configured attachment_f. It's working fine on Local(development)
> system but giving problem on production. Basically on production the
> attachment_fu is not able to generate thumbnail image it saving the original
> size image. Below is the configuration.
>
>   has_attachment :content_type => :image,
>                  :storage => :file_system,
>                  :max_size => 500.kilobytes,
>                  :thumbnails => {:thumb => '170x60>'},
>                  :processor => 'Rmagick',
>                  :path_prefix => 'public/store_images'
>
> Is any idea what can be an issue?
>
> Regards
> Abhi
--~--~-~--~~~---~--~~
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: Calendar control

2009-04-08 Thread Eric

On Apr 8, 7:43 am, Sushrut Sathe 
wrote:
> what is sedu gem?
> how to get that & use calendar control

For calendars, I use either of the following two, depending on the
purpose:

http://code.google.com/p/calendardateselect/
http://github.com/topfunky/calendar_helper/tree/master
--~--~-~--~~~---~--~~
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: Problem with MYSQL after re-installing rails

2009-04-07 Thread Eric Bolden

Try installing the mysql gem with

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/ 
usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql- 
include=/usr/local/mysql/include

from:
http://newwiki.rubyonrails.org/database-support/mysql

On Apr 7, 2009, at 5:53 AM, Gavin wrote:

>
> Hey all-
>
> Re-installed OSX yesterday and with it, Ruby and Rails
>
> Now when I try to run db:migrate I get the error message:
>
> "!!! The bundled mysql.rb driver has been removed from Rails 2.2.
> Please install the mysql gem and try again: gem install mysql.
> Rake aborted!
>
>


--~--~-~--~~~---~--~~
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: Just can't get Ruby on Rails to work in Leopard

2009-04-06 Thread Eric Bolden

I have found this site to be consistently useful
http://newwiki.rubyonrails.org/database-support/mysql

I used this command:

$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/ 
lib \
--with-mysql-include=/usr/local/mysql/include


This was on several different installs of Leopard. Both new Leopard  
installs, and version of Leopard that had been upgraded from  
functioning older versions of rails.

I had one issue, where the installed version of mysql was too old, but  
that was fixed after I upgraded to the current version.

I am using an older mysql install. I prefer 5.0 over 5.1 right now.  
5.0.77 is the current version I am installing.
http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg

Eric


On Apr 5, 2009, at 2:19 AM, Scott Corgan wrote:

>
> I've tried a million different tutorials and I just can't figure this
> out. I have all things needed to create the development environment
> and I just can't get the server to function correctly I suppose.
> Here's the error I am getting:
>
> "The bundled mysql.rb driver has been removed from Rails 2.2. Please
> install the mysql gem and try again: gem install mysql.
> /!\ FAILSAFE /!\  Sun Apr 05 00:17:39 -0700 2009
>  Status: 500 Internal Server E rror
>  dlsym(0x1c44680, Init_mysql): symbol not found - /usr/local/lib/ruby/
> gems/1.8/gems/mysql-2.7/lib/mysql.bundle"
>
> And then when I got to localhost:3000 and click on the "About your
> application's environment", I get a red box that says "We're sorry,
> but something went wrong.We've been notified about this issue and
> we'll take a look at it shortly" that drops down.
>
> I can't find a solution anywhere.
>
> Does anyone have any suggestions? Please help! I've spent hours and I
> can't find anything.
>
> Thank 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: Many to many in separate has_one controller

2009-04-01 Thread Eric

This is part of what has_many :through is for. You already have an
enrollments model, so you can just create a controller for it, adding
extra attributes where necessary (cancelled, etc.).

-eric

On Apr 1, 11:38 am, mark_d  wrote:
> Hi.
>
> I have a problem deciding the best way to manage a many_to_many
> relationship.
>
> It define the relationships as so:
> [code]
> ## models
> # student model
> student has_many subjects :through => :enrollments
>
> # subject model
> subject has_many students :through => :enrollments
>
> # enrollments model
> belongs_to  :student
> belongs_to  :subject[/code]
> How can I have a separate controller to manage a students enrollments
> from one page? Imagine a student page with radio buttons defining
> their relationship with a subject, something like [enrolled, deferred,
> cancelled] for example. This would surely be a one_to_one relationship
> from a routing perspective. My idea was to define this extra
> controller but I'm quickly thinking I'm going the wrong way with this.
> [code]
> map.resources :student, :has_one => :curriculum, :except =>
> [:new, :create][/code]
> Within the controller and the view, what would the form_for be for?
> There is no curriculum model, and I can't have a form_for a
> relationship (can I?).
>
> Thanks in advance.
--~--~-~--~~~---~--~~
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: No such file or directory - layouts/application.html.erb

2009-03-30 Thread Eric

On Mar 30, 11:43 am, Bharat Ruparel 
wrote:
> What is it that I am missing here?

<%= render :file => "layouts/application" %>

That comports with your error, right? Seems too simple of a solution,
but keep in mind that the application layout will be used
automatically anyway, if there isn't one for the current controller.
--~--~-~--~~~---~--~~
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: RubyonRails GUI for Leopard?...

2009-03-30 Thread Eric Fer

One more point for TextMate. Quite clean and lightweight.
A few colleagues of mine are using MacVIM and they were using TextMate
before that.

See ya
Eric Fer

On Mar 28, 7:30 pm, zensuite  wrote:
> Hi everybody, I'm a web developer interested on moving to rubyonrails
> framework, and I'm looking for a good GUI or integrated suite to
> develop rails under leopard, or linux.
>
> Could do you give me any advise about it?...
>
> I will appreciate your help.
>
> Thanks folks.
>
> See ya!!

--~--~-~--~~~---~--~~
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: Output to Printer

2009-03-26 Thread Eric

I'm not sure if I understand completely, but I would just render a
'printer_friendly' layout.

And you do know that Rails itself is not GPL, right?

On Mar 26, 5:03 pm, eengnerd  wrote:
> It was very surprising to me to find out that there is no current,
> GPL'ed "ruby-" package designed for outputting HTML / CSS pages to a
> printer.  For reasons of principle, I won't use any add on modules for
> ruby that are not GPL'ed.  Does anyone know of a package currently
> under development that is at least reasonably close to such support?
>
> Arthur
--~--~-~--~~~---~--~~
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: remote_form_for ajax validation

2009-03-25 Thread eric

Like commonly with regular forms, I prefer javascript validation
before the form submits. I happened across what I think is a valid
method.

<% remote_form_for(product, :before => "if(!validateForm(this))
{ return false; }") %>

Where validateForm is a javascript function that does the form
validation. Note that using this method, the javascript function MUST
return a boolean, either true for valid data, or false if not. If it's
not valid then the form won't submit. Within the javascript you can
put alerts or change the html with error messages so that the user can
correct their input data.


On Mar 15, 3:59 pm, Isaac  wrote:
> Hi,
>
> I have been reading a lot about this, but I do not manage to do a nice
> validation. I already managed to save data to the database, to
> validate a field, to display a "Everything went well" message. I can
> also display an error message, but the view does not end up properly.
>
> This is the form:
>
> <% remote_form_for(product) do |f| %>
>     <%= f.error_messages %>
>           
>                   <%= f.label :title  %>
>                   <%= f.text_field :title %>
>           
>           
>                   <%= f.label :body  %>
>                   <%= f.text_area :body %>
>           
>           
>             <%= f.submit "Update" %> ó
>          
>   <% end %>
>
> This is the controller:
>
> def update
>     @product = Product.find(params[:id])
>     respond_to do |format|
>       if @product.update_attributes(params[:product])
>         flash[:notice] = 'OK!'
>         format.html { redirect_to(@product) }
>         format.js
>       else
>         flash.now[:notice] = 'Error!!'
>         format.html { render :action => "show" }
>         format.xml { render :xml => @product.errors,  :status
> => :unprocessable_entity }
>         format.js
>       end
>     end
>   end
>
> The model:
>
> class Product < ActiveRecord::Base
>   validates_presence_of :title
> end
>
> And the RJS template:
>
> page.replace_html :description, :partial => "product", :object =>
> @product
> page.replace_html :notice, flash[:notice]
> page.visual_effect (:fade, "notice", :duration => 2)
> flash.discard
>
> But I thing there is a better way to validate forms.
>
> Does any one have an example about validating, and displaying
> customized messages.
>
> Br,
>
> Isaac

--~--~-~--~~~---~--~~
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: advanced search for a model (including keywords)

2009-03-25 Thread Eric

It's really basic search you're looking for. 100,000 records is not
that many, use acts_as_ferret with a local index and you'll be fine
for quite a while.

On Mar 25, 7:25 am, aupayo  wrote:
> Hello,
>
> I am new in rails and I am working in an application which requires
> advanced search.
> I have a model called Item which has various attributes like "weight",
> "price", "category", "age"...and then it has some "keywords",
> describing the Item.
>
> I would like to implement an advanced search where the users can
> search Items using the attributes that they want.
>
> After googling some time, I found that:
>
> - acts_as_taggable could be useful for the "keywords" attribute.
> - acts_as_ferret could be useful for searching the tags (I would need
> to search for multiple tags in the same query, include some fuzzy
> search...)
> - Searchlogic would be very useful to implement the search with all
> the attributes, but I am not sure if it can cope with the
> acts_as_taggable plugin, or if I should implement the keywords just
> using a String attribute, or how to do it.
>
> Well, I know I have a lot of work to do, but I would really appreciate
> if someone could give me some hints in order to point the direction in
> which I should work. Which is the best way (or simplest) in your
> opinion to implement this search?
>
> The application will have to deal with "many" records (lets say
> 100.000), so I would also appreciate receiving some comments regarding
> speed...however it doesn't have to be the faster app in the world, in
> this moment I prefer an easier development and I'll improve the app in
> the future if needed.
>
> Thanks a lot for your help.
--~--~-~--~~~---~--~~
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: find :all using :group

2009-03-23 Thread Eric

On Mar 23, 11:38 am, Frederick Cheung 
wrote:
> On Mar 23, 2:21 pm, Ayeye Brazov 
> wrote:
>
> > User.find(:all, :group => :os)
>
> > however, the result is an array having only one user for each os group.
> > I'd like to have ALL the users grouped  by :os though
>
> > One solution is to write
>
> > User.find(:all).group_by{|u| u.os}
>
> > However, I wonder if it could be done within the "find" method ?
>
> Not really. By definition if you group using the database then you
> only get back one row for each value of the grouped column  - that's
> just what group does in database and you want something else.

...such as :order => 'os ASC'
--~--~-~--~~~---~--~~
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: Rails making it tougher for newbies?

2009-03-21 Thread Eric

Books are very much lagging indicators of the state of Ruby on Rails.
The best documentation (for better or worse) is on the web. Start at
http://guides.rubyonrails.org/

On Mar 21, 3:12 pm, Power One 
wrote:
> I'm trying to learn how to use ruby on rails.  Just two weeks ago I'm
> learning how to program in Ruby, but now I'm ready to get onto with
> rails.  I got a book for rails but it shows me rails examples that only
> work with rails 1.2.3.  I follow the examples, but many are not working.
> For example, scaffold is not working with 2.1.0 (rails version install
> in my computer.
>
> My question is, how do you go about scaffold in rails 2.1.0?  Some
> pagination is not working out of the box such as will_pagination and
> classic_pagination.  Ubuntu 8.10 is making rails more difficult, and
> installing will_pagination from gems didn't do the trick.
>
> Anyone know a complete tutorial that teaches how to install all
> necessary gems/plugins/debian packages that will help me smooth-sailing
> in my ruby on rails adventure?  Thank You.
>
> Also I couldn't find a good beginning ruby on rails book that is
> up-to-date, and I know ruby on rails is a very fast moving framework as
> ruby is also a very fast moving programming language -- things are
> changing constantly for the better.  Any guide to better rails way?
>
> Thanks...
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: attachment_fu doesnt resize photo and create thumbnails

2009-03-16 Thread Eric

You should verify that your configured processor, such as rmagick/
imagemagick, is installed and available to the user under which the
application runs.

On Mar 16, 9:57 pm, Tam Kbe  wrote:
> Hello,
>
> I'm trying to use attachment_fu in order to upload photo and create
> three versions of thumbnails (large small and medium). This works
> perfect of my mac book. but on my production server it uploads the image
> but doesn't create three version of thumbnails!! I researched on the
> site and googled a bit, and tried couple of things suggested with no
> success.
> My server has Linux Debian on it (VPS)
>
> Here is what the photo model looks like:
> --
> class Photo < ActiveRecord::Base
>    belongs_to :account, :foreign_key => :account_id
>    belongs_to :user, :foreign_key => :user_id
>
>    has_attachment :content_type => :image,
>                   :storage => :file_system,
>                   :max_size => 500.kilobytes,
>                   :resize_to => '384x256>',
>                   :thumbnails => {
>                     :large => '150x150>',
>                     :medium => '64x64>',
>                     :small => '48x48>'
>                   }
>
>    validates_as_attachment #to prevent image sizes out of range from
> being saved
> end
> --
>
> I checked in the log files (production.log, mongrel.log and apache error
> log with no errors showing!) Any ideas how I can approach this problem.
>
> Your help is appreciated.
>
> Tam
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Interesting arrangement

2009-03-13 Thread Eric

http://railscasts.com/episodes/28-in-groups-of

On Mar 13, 2:06 pm, DanC  wrote:
> Hi all,
>
> I have been asked to develop an app which basically displays 100
> images on a homepage arranged in a 10 x 10 grid.
>
> I have been using attachment_fu to upload images although I hear great
> things about paperclip. Anyway, that is the easy part.
>
> Does anyone have any advice about how best to arrange the images on
> the page in a clever database way so I can just call all of the
> pictures in my controller and they will each be allocated to a space
> on the grid automatically?
>
> I know this isn't a pure rails problem, but whilst I can think of lots
> of long-winded manual ways of arranging images, I am sure there must
> be better way.
>
> Thanks,
>
> Dan
--~--~-~--~~~---~--~~
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: Making the 'Back' link look the same as form.submit "Save"

2009-03-10 Thread Eric

What "cool blue box?" My submit buttons just look like buttons, so you
probably already have some CSS that you could copy.

On Mar 10, 1:31 pm, InventoryTrackers 
wrote:
> Does anybody know how Rails paints that cool blue box around the <%=
> form.submit "Save" %>
> In most of my forms I've got a "Back" link ( ex: <%= link_to 'Back',
> return_path %>.
>
> I'd like this link to share the same 'look and feel'.
>
> When I look at the browser source the code that rails generates it
> shows this;
>
>   
>      value="Save" />
>   
>
> Has anybody built .css around any of these properties to make this
> link look like the same graphic button created by <%= form.submit
> "Save" %>?
>
> David
--~--~-~--~~~---~--~~
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: Can RoR do this? How easily?

2009-03-04 Thread Eric

adding an entire language with bells and whistles would complicate
your install package immensely. given your reqs I'd just plan to run
the whole thing in the browser and move it to .js and maybe a filedb.

On Mar 4, 2:46 pm, Zonker  wrote:
> I am consulting on a software project which is database intensive and
> the interface is web-based. Users can download an installation package
> which, if necessary, installs Microsoft IIS, some free Microsoft
> database server (I think it's a stripped-down version of MS-SQL) and
> then the HTML, ASP, and JavaScript-based app. It only runs on Windows
> machines and only works in IE. Oh, and it needed certain tweaks or
> patches to make it work under Vista; the version which worked under XP
> didn't work 100% in Vista.
>
> As one who appreciates standards and not being tied to one technology,
> especially browsers, and having seen the database design and the
> actual app in action, plus lots of insight into how difficult it is to
> maintain, upgrade, etc., my immediate thought was: it must be possible
> to do it better by adhering to web standards as much as possible
> (rather than as little as possible), break the dependence on MS
> products, etc.
>
> I'm a huge fan of RoR but still relatively new to it, but based on my
> readings (Agile Web Dev for Rails) and investigations, I thought that
> this app would be perfect for RoR.
>
> But, before I suggest making a switch which will take lots of time and
> cost lots of money, I need to know how easy it would be for anyone to
> take a basic office computer with just XP or Vista (or Mac!) and
> install all that is necessary: a web server, a database, Ruby and
> Rails, and the app itself?
>
> What would need to happen is:
>
> 1. User downloads my-app-install.zip
> 2. User unzips download
> 3. User runs install-my-app.bat or something like that.
> 4. User opens any browser and enters: my-app.local (or whatever) and
> the app starts.
>
> Is there a way to do this with a RoR solution?
>
> Note: This web-based app would only be run locally, not as a general
> website available to all.
>
> I'd be really interested if anyone has done something like this or if
> anyone has some thoughts on the matter.
>
> If I'm not being clear, please let me know - I'll try to rephrase.
>
> Regards,
> Zonker
--~--~-~--~~~---~--~~
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: Linking to an external model/view within an application

2009-02-28 Thread Eric

link_to(sub_article.title, sub_article)

Rails knows the rest.

-eric

On Feb 28, 11:33 am, Jimmy Perrine 
wrote:
> Hey guys,
>
> I am working on a class project and I have two scaffolded models,
> articles and sub_articles. I have the relationships set to articles
> having many sub_articles and sub_articles belonging to articles, which
> is also stated in the routes file.
>
> I am trying to display a link to each sub article when viewing a
> specific article, as it stands now I can display the link with the sub
> article title but it links back to the same article.
>
> here are some code samples:
>
> this is my sub article partial that shows the links,
>
> <%= link_to (sub_article.title), h(sub_article.id) %>
>
> how do i add the prefix sub_articles/ to the id link?
>
> also when I go to a url like /sub_articles/1 I get an unknown action
> error, but I have a show.html.erb file
>
> your help would be greatly appreciated, thank you all.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Polymorphic association..explain the extra query ?

2009-02-27 Thread Eric

It has nothing to do with polymorphism. You'll want to look into eager
loading for your associations if you want to avoid those queries.

http://railscasts.com/episodes/22

-e

On Feb 27, 9:58 am, Arpit Jain  wrote:
> Can anyone explain to me the sql query done in the last step :
>
> http://pastie.org/402200
>
> --
> Arpit Jain
--~--~-~--~~~---~--~~
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: tagging

2009-02-26 Thread Eric

On Feb 26, 6:21 am, Ar Chron  wrote:
> +1 to laziest post on the board...

I wouldn't go that far. After all, he didn't demand that you write and
post a working implementation like others do.

-e
--~--~-~--~~~---~--~~
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: Getting started, sort of

2009-02-25 Thread Eric

You did ask for "any help," right? Well that's weird, then, because
from my computer the #1 hit on that search has the exact fix in the
comments. Not good enough?

On Feb 25, 3:43 pm, bachcole  wrote:
> This was not all that helpful.  I am sure that it is because I am
> ignorant, but it was nevertheless not helpful.  What do I do?
> Uninstall my current version of gem and install the earlier version?
>
> On Feb 25, 4:23 pm, Eric  wrote:
>
> > > Any help or ideas would be appreciated
>
> > Somewhere in 
> > here:http://www.google.com/search?q=windows+sqlite3-ruby+native+extension
--~--~-~--~~~---~--~~
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: Getting started, sort of

2009-02-25 Thread Eric

> Any help or ideas would be appreciated

Somewhere in here: 
http://www.google.com/search?q=windows+sqlite3-ruby+native+extension
--~--~-~--~~~---~--~~
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: Implementing a web service in rails

2009-02-24 Thread Eric

Help and advice for what? I can't find a question in there.

-e

On Feb 24, 4:17 pm, Ryan Leary 
wrote:
> Hi all,
>
> I need to implement a web service in rails with the following signature:
>
> string ReceiveEvents (string A, string B, string C).
>
> As you can see, it is basically a method that takes in three strings and
> returns a string. I'm 99% sure the call is made via SOAP.
>
> I've spent all day searching around (SOAP4R, AWS, . . .) but have not
> been able to find any compelling help.
>
> Any advice is appreciated. Thanks!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Collection of Partials, :as Option No Good, TemplateError

2009-02-24 Thread Eric

On Feb 24, 1:54 pm, MaggotChild  wrote:
> On Feb 24, 11:54 am, Eric  wrote:
>
> > On Feb 24, 11:13 am, MaggotChild  wrote:
> > > I'm trying to render a collection of partials using :as. It raises an
> > > undefined local variable exception. Not sure why:
> > Why not use :locals => ?
>
> Sure there a workarounds, but they don't explain why :as won't work.

You're right, of course (except for locals being a workaround), and it
seems like they should work the same or similar, but since :as is
nearly impossible to Google for I recommend whatever workable method
presents itself. That is, all other things being equal, whichever
method is better documented is the stronger one. But that's just 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] Re: render :update problem

2009-02-24 Thread Eric

Is there an error in the log at all for your current implementation?

On Feb 24, 12:02 pm, Me  wrote:
> All I am trying to do is to put a different partial in place of the
> the once that is already there.  Not an ajax call to the function.
>
> On Feb 24, 12:32 pm, Chris Habgood  wrote:
>
> > Not an ajax call.  Does it only work for an ajax call?
>
> > On Tue, Feb 24, 2009 at 12:31 PM, Frederick Cheung <
>
> > frederick.che...@gmail.com> wrote:
>
> > > On 24 Feb 2009, at 18:14, Me wrote:
>
> > > > I have this div in my application.rhtml file:
>
> > > >  <%= render :partial => 'ericssoncards' %>
>
> > > > When I go to another view I am doing this:
>
> > > > def turin2000
> > > >               render :update do |page|
> > > >                       page[:shelfcards].replace_html :partial =>
> > > 'turin2000'
> > > >               end
> > > >  end
>
> > > What does the think making the ajax request look like ?
>
> > > Fred
> > > > I get this for an output:
>
> > > > try {
> > > > $("shelfcards").update("
> > > > \nSelect your card type\n\n\t > > > class='card' >OC-192\n\tOC-48 > > > div>\n\tOC-12\n\t > > > \t\tclass='card' >OC-3\n\t > > > \tclass='card' >28P DS-1\n\t > > > \tclass='card' >EGCM\n\t > > > \tclass='card' >GB ETH\n\t > > > \tclass='card' >VT 5G\n \t\t");
> > > > } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('$
> > > > (\"shelfcards\").update(\"\
> > > > \nSelect your card type\\n\\n\\t > > > class=\'card\' >OC-192\\n\\t > > > \' >OC-48\\n\\tOC-12 > > > div>
> > > > \\n\\tOC-3\\n\
> > > > \t28P DS-1\\n\
> > > > \tEGCM\\n\
> > > > \tGB ETH\\n\
> > > > \tVT 5G\\n > > > fieldset> \\t\\t\");'); throw e }
>
> > > > If I put this partial inside the div manually it works fine.
>
> > > > What causes 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
-~--~~~~--~~--~--~---



[Rails] Re: Collection of Partials, :as Option No Good, TemplateError

2009-02-24 Thread Eric

Why not use :locals => ?

On Feb 24, 11:13 am, MaggotChild  wrote:
> I'm trying to render a collection of partials using :as. It raises an
> undefined local variable exception. Not sure why:
>
> ~/delivery-log/app/views/packages $ ls -1
> _package.html.erb
> _package_list.html.erb
> index.html.erb
>
> index.html.erb:
> <%=
> render :partial=>'package_list', :collection=>@packages, :as=>:package
> %>
>
> _package_list.html.erb:
> 
>   <%= package.upc %>
> 
>
> Seems simple, but it only raises the aforementioned exception:
>
> ActionView::TemplateError (undefined local variable or method
> `package' for #) on line #2 of packages/
> _package_list.html.erb:
> 1: 
> 2:   <%= package.upc %>
> 3: 
--~--~-~--~~~---~--~~
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: Simple Tree view code required

2009-02-23 Thread Eric

What didn't work about them? What was lacking?

On Feb 23, 10:06 pm, Tony Puthenveettil  wrote:
> Hi all,
>
> Being a newbie in Ruby, I'm really fed up trying almost all the
> available tree examples in net like YUI Tree, dhtmlxTree, LiveTree in
> vain. None of them worked for me.
> Could anyone please give me a simple example (preferably end-to-end) of
> Tree view?
> Requirements: 3 levels of items, Data may be fetched from more than 1
> table.
>
> Please help me...
>
> Tony Puthenveettil
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Security risks of cookie-based session storage

2009-02-23 Thread Eric L.

Good point.  I realized risk #1 could be reduced by storing the secret
in a secure place on the deployment server rather than under source
control.

On Feb 21, 3:20 pm, Frederick Cheung 
wrote:
> On Feb 21, 5:06 pm, "Eric L."  wrote:
>
> > Should I be concerned if I am using the default cookie-based session
> > storage for a high security application?  Nothing sensitive will be
> > stored on the cookie, but it's critical that one user cannot gain
> > access to another user's account.  The security risks I see with
> > cookie-based storage are:
>
> > 1. There is a single point of failure.  If the secret key is stolen
> > (for example, by a rogue developer), the person in possession of the
> > key can log into any account he wishes.
>
> > 2. It's not been as widely used as database-backed session, and
> > therefore not as tested.
>
> given that it's been the default for well over a year I would question
> that.
>
> > 3. The cryptographic algorithm could be compromised, which is always a
> > possibility (however unlikely.)
>
> While the risks in 1 and 3 do exist I don't think it's a game changer
> compared to the other risks involved (people setting weak passwords,
> the cryptographic algorithm securing your ssh or ssl sessions being
> compromised and data being leaked that way, the rogue developer
> harvesting data straight from the database, cookies being stolen via
> XSS attacks etc.)
>
> 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
-~--~~~~--~~--~--~---



[Rails] Re: How can I know if a file has been attached?

2009-02-22 Thread Eric

> How can I test if the variable "file" is empty or not?
> Thank you!

Answer should be somewhere here: 
http://www.tutorialspoint.com/ruby/ruby_methods.htm
--~--~-~--~~~---~--~~
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: How to get the ID of the object I just saved in the DB?

2009-02-22 Thread Eric

Try: puts @post.inspect

and check your logs

On Feb 22, 5:24 pm, Guillaume Loader  wrote:
> What do you mean?
> That I should do this : @post.post_id ?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: CHECK if param exists? please help

2009-02-22 Thread Eric

On Feb 22, 3:46 pm, Phlip  wrote:
> Eric wrote:
> > Use the ternary/comparison operator. I've removed your strptime stuff,
> > but the idea is like so:
>
> > @from_date = params[:startdate] ? params[:startdate] : (Time.now -
> > 3.months.ago)
>
> 3.months.ago is an absolute time (probably "seconds since 1970"). So the
> "Time.now -" is implied.

It was just for illustration.
--~--~-~--~~~---~--~~
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: How to get the ID of the object I just saved in the DB?

2009-02-22 Thread Eric

Don't you still have @post?

On Feb 22, 4:25 pm, Guillaume Loader  wrote:
> Hello everyone!
>
> Does the method save return the ID ?
> Because i'm doing this :
>
> if @post.save
> flash[:notice] = 'Post was successfully created.'
> end
>
> and I need the ID of the post I just created. I think it could work with
> : Post.find(:last) but what if two people are posting at the same time?
>
> Thank you!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: CHECK if param exists? please help

2009-02-22 Thread Eric

Use the ternary/comparison operator. I've removed your strptime stuff,
but the idea is like so:

@from_date = params[:startdate] ? params[:startdate] : (Time.now -
3.months.ago)
@to_date = params[:enddate] ? params[:enddate] : Time.now

"If params[:startdate], then @from = params[:startdate], else @from =
time.now - 3.months.ago"

-eric

On Feb 22, 10:34 am, Dave Smith 
wrote:
> hi folks.
>
> i want to check if a param exists if not to set it to a default value
> for my date range filter. in my controller i have:
>
>   @from_date = Date.strptime(params[:startdate],"%d/%m/%Y")
>     @to_date = Date.strptime(params[:enddate],"%d/%m/%Y")
>
>     @articles = @results.find(:all,
>                             :conditions => [ "created_at >= ? and
> created_at <=?",@from_date,@to_date],
>                             :order => 'created_at desc', :page => {:size
> => 5, :current => params[:page]})
>
> this works as long as i have the params in the query string in the
> address. but if i remmove them i want to be able to default to a date
> range from today back a couple of months.
>
> is there a param[:startdate].exists? check i can do???
>
> any help asap would be great!!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: guides on css strategy

2009-02-21 Thread Eric L.

I had the same question when I was starting out with CSS.  A lot of is
simply trial and error, and you figure out what is best.  Buy a good
book on CSS (I read Bullet Proof CSS design), and that will give you
some guidance as to what's the best class/id naming style.  In general
I follow these rules:

1. Use ID for unique element.
2. Use class for shared elements.
3. Scope CSS selector properly, so it's as specific as possible.  It's
a terrible thing to work on a code base where the previous developer
specified style on something generic like ".first", then everything in
the site that is of class "first" would be impacted by this style.


On Feb 17, 5:44 pm, itsastickup  wrote:
> I'm having to design the UI to a small site, and that means dabbling
> in css. I've never been able to get any kind of decent idea as to how
> to decide on classes and id-ing. I've had a sniff around the internet
> without success: people seem to be as clueless as me. I've even
> examined the css/markup of a few sites and it hasn't been
> enlightening.
>
> Does anyone know of a good source of info on css class decisions, and
> ids? Even better with rails inm ind. Something that broke through for
> you might be good. I'm not so interested in how css works: that's easy
> to find, and I have a pretty good idea already.

--~--~-~--~~~---~--~~
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] Security risks of cookie-based session storage

2009-02-21 Thread Eric L.

Should I be concerned if I am using the default cookie-based session
storage for a high security application?  Nothing sensitive will be
stored on the cookie, but it's critical that one user cannot gain
access to another user's account.  The security risks I see with
cookie-based storage are:

1. There is a single point of failure.  If the secret key is stolen
(for example, by a rogue developer), the person in possession of the
key can log into any account he wishes.

2. It's not been as widely used as database-backed session, and
therefore not as tested.

3. The cryptographic algorithm could be compromised, which is always a
possibility (however unlikely.)

What do you think?

Eric

--~--~-~--~~~---~--~~
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: belongs_to or has_many

2009-02-21 Thread Eric

Any chance of taking this list moderated?

On Feb 21, 1:39 pm, Jo Jo  wrote:
> 2 tables Items and Categories
>
> Categories (id, name)
> Items (id, name, category_id)
>
> Category_id can be null, and there are Categories that has not an Item.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: How do I access a variable defined in application.rb from within application.rhtml?

2009-02-21 Thread Eric

So why not use that, then? Whatever works...

Also, you might brush up on MVC and beginner's Ruby as far as "setting
variables in models" go:
http://wiki.rubyonrails.org/rails/pages/UnderstandingRailsMVC

On Feb 21, 12:45 pm, ericindc  wrote:
> Title pretty much explains it.  I'd like to set a variable the stores
> a single Model object inside of application.rb since it will be used
> on every single page.  I've tried both class and instance variables,
> but to no avail.  The only thing that worked so far was using a global
> ($) variable.
--~--~-~--~~~---~--~~
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] New to Ruby Need some help.

2009-02-19 Thread Eric Raio

I am quite new to ruby on rails so bare with me.

I just got an interesting repository from github and I have been trying
diligently to get this app to work. This seems like a general error to
me but I do not understand how to fix it.

If some one could help I would definately appreciate it

Thanks.






NameError in UsersController#new

uninitialized constant UsersController

RAILS_ROOT: /Users/atrocity/dev/magic_the_gathering
Application Trace | Framework Trace | Full Trace

/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:445:in
`load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:77:in
`const_missing'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:89:in
`const_missing'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/inflector.rb:352:in
`constantize'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/inflector.rb:351:in
`each'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/inflector.rb:351:in
`constantize'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/string/inflections.rb:162:in
`constantize'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/route_set.rb:388:in
`recognize'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in
`load_without_new_constant_marking'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in
`load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in
`load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in
`require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in
`require'

/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:182:in
`handle_request'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in
`dispatch_unlocked'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in
`dispatch'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in
`synchronize'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in
`dispatch'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in
`dispatch_cgi'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in
`dispatch'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in
`process'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in
`synchronize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in
`process'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in
`process_client'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in
`each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in
`process_client'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
`initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
`new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
`run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in
`run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in
`each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in
`run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gem

[Rails] Re: Nested Resources: How to view all children resources

2009-02-06 Thread Eric

you just need to create an un-nested route for tasks:

map.resources :tasks

outside of the nested routes block. they won't conflict.

On Feb 6, 7:59 pm, Adam Akhtar 
wrote:
> I want to be able to view all the children resources in a nested
> resoruce scheme.
>
> Ie. if i have projects and tasks I want to be able to view every single
> task like this /tasks
> rather than
> /project/1/task
>
> Can anybody help?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Controller design for app with different user types

2009-02-02 Thread Eric

Roles are fairly well-documented in the blogosphere, even if the roles
are entirely orthogonal. Here are a few readings to get you started:

http://metautonomo.us/2008/09/30/easy-role-based-authorization/
http://railsforum.com/viewtopic.php?id=1579
http://www.vaporbase.com/postings/Authorization_in_Rails

Are the views actually that different? It may be just that the content
of the profiles is determined by the user's role(s), but the template
can remain the same for all roles.

On Feb 2, 9:31 am, Joey Ar  wrote:
> Hi,
>
> I am trying to implement an application where there are different types
> of users (about 5-6). The privileges of each type of user varies pretty
> drastically and hence when each logs into the application, each will
> have his own home page and set of things that he can do that differs
> from other types of users.
>
> Since the views would also change (or rather look totally different) for
> each of them, I thought it would be better to have totally different
> controllers and actions based on the type of users. I have been reading
> about how to design this kind of an scenario but have not been able to
> stumble upon a sound design as of now. There was one reference to
> namespaced controllers... do you think this would be the best approach
> for the situation in hand. If you know of any tutorial, that would be
> useful.
>
> Plus, I see that a lot of my actions don't fall just within the CRUD
> actions, I need more... can some lead me to design tips or tutorials for
> such a thing too? Any help is appreciated. Thanks in advance!
>
> -J
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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 command is used to list the gems used by an application?

2009-02-01 Thread Eric

rake gems

also: rake --tasks

On Feb 1, 8:24 pm, olivierntk  wrote:
> Hi, I have been working on an application for a few months and
> installed some gems, but I don't remember the exact list.
>
> I want to deploy my app and I need to install the gems I used. Which
> command line is used for that?
>
> thank u
--~--~-~--~~~---~--~~
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: NoMethodError: undefined method `expenses'

2009-01-28 Thread Eric

UMQ: Use More Quotes!

:vendor => "vendor1", :amount => "75.00"

On Jan 28, 9:22 pm, Andrew Reid 
wrote:
> Hi,
> I am trying to figure out why I am receiving the following error.  I am
> following an Apple Developers Rail Application tutorial.
>
> >> event.expenses.create(:vendor => vendor1, :amount =>75.00)
>
> NameError: undefined local variable or method `vendor1' for
> #
>   from (irb):2
>
> Here is what I have for the models
>
> class Event < ActiveRecord::Base
>   validates_presence_of :name
>   validates_numericality_of :budget, :greater_than => 0.0
>
>   has_many :expenses
>   has_many :vendors, :through => :expenses
> end
>
> ___
>
> class Expense < ActiveRecord::Base
>   belongs_to :event
>   belongs_to :vendor
> end
>
> ___
>
> class Vendor < ActiveRecord::Base
>   has_many :expenses
>   has_many :events, :through => :expenses
> end
>
> I read another post where they had issues with Xcode not saving and
> having to restart terminal.  I have done both and everything looks
> right.
> Thanks in advance for any help!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: MySQL and RoR 2.2.2 -- deadlock?

2009-01-19 Thread Eric Bolden

Hi Kedar,

I am certainly no expert, but I suffered with the error for several  
days too.

I think you need more information on your install line.

I used for OSX 10.5
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/ 
mysql_config

from: http://www.scribemedia.org/2009/01/02/installing-mysql-gem-on-mac-osx-105/

I have included the other links I browsed on the way to the solution  
too. There is likely a path difference with Ubuntu, but maybe this  
will help.

Eric

http://discuss.joyent.com/viewtopic.php?id=5992
sudo gem install mysql -- --with-mysql-include=/usr/local/mysql/ 
include/ with-mysql-lib=/usr/local/mysql/lib/

•   A similar change (when rebuilding mysql) was required to 
install  
the mysql gem:
◦   ./configure  --prefix=/web/pkg/mysql/mysql  ...  
CPPFLAGS='-fPIC'
◦   
•   Installing the mysql gem also required an additional option to  
help it find the libraries
◦   sudo gem install mysql -- --with-mysql-config=/web/pkg/mysql/ 
current/bin/mysql_config

I also looked here.

http://pjforpresident.com/2008/06/20/compiling-mysql-native-bindings-on-os-x-macports/
http://blog.bmn.name/2008/02/rails-gem-install-mysql-throws-error-extconfrb-failed/
http://blog.springenwerk.com/2008/11/rails-22-and-native-mysql-gem-on-mac-os.html

On Jan 19, 2009, at 9:29 PM, Kedar Mhaswade wrote:
>
> - I press on.
> - ke...@kedar-laptop:~/Projects/ror/people$ sudo gem install mysql
> [sudo] password for kedar:
> Building native extensions.  This could take a while...
> ERROR:  Error installing mysql:
>  ERROR: Failed to build gem native extension.
>


--~--~-~--~~~---~--~~
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: Ruby Debug Not Working

2009-01-18 Thread Eric J

Well it started working, so maybe it was mongrel!

Thanks for your help guys.



On Jan 18, 8:27 am, Teedub  wrote:
> I think you need mongrel fordebug
> try
> script/server mongrel
>
> On Jan 18, 6:21 am, Eric J  wrote:
>
> > I put require "ruby-debug" at the top of config/environments/
> > development.rb. I just tried moving it to the bottom of the file and
> > that didn't seem to help either.
>
> > I put the command 'debugger' at the start of one of my controller
> > methods, so it should hit the controller and then call debugger.
>
> > On Jan 18, 7:13 am, Fernando Perez 
> > wrote:
>
> > > Eric J wrote:
> > > > I installedruby-debugusing this command:
> > > >   sudo gem installruby-debug-y
>
> > > > and then added the line to config/environments/development.rb:
> > > >   require "ruby-debug"
>
> > > > I restarted webrick and put 'debugger' in my code and tried to access
> > > > the page with the debugger command, but it didn't do anything. I've
> > > > tried several times and restarted webrick, to no avail.
>
> > > > rails 2.1.1
> > > > ruby1.8.6
> > > >ruby-debug-0.10.3
>
> > > > Eric
>
> > > Where did you put the require statement and where did you put the
> > > debugger method for instance?
>
> > > --
> > > Video training screencasts athttp://www.digiprof.fr
> > > --
> > > Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Ruby Debug Not Working

2009-01-18 Thread Eric J

I installed mongrel and tried it, but no debugging luck. I tried
adding Debugger.start after the 'require "ruby-debug"'.

Is there a debug flag that you need to add to the start up command?



On Jan 18, 8:27 am, Teedub  wrote:
> I think you need mongrel fordebug
> try
> script/server mongrel
>
> On Jan 18, 6:21 am, Eric J  wrote:
>
> > I put require "ruby-debug" at the top of config/environments/
> > development.rb. I just tried moving it to the bottom of the file and
> > that didn't seem to help either.
>
> > I put the command 'debugger' at the start of one of my controller
> > methods, so it should hit the controller and then call debugger.
>
> > On Jan 18, 7:13 am, Fernando Perez 
> > wrote:
>
> > > Eric J wrote:
> > > > I installedruby-debugusing this command:
> > > >   sudo gem installruby-debug-y
>
> > > > and then added the line to config/environments/development.rb:
> > > >   require "ruby-debug"
>
> > > > I restarted webrick and put 'debugger' in my code and tried to access
> > > > the page with the debugger command, but it didn't do anything. I've
> > > > tried several times and restarted webrick, to no avail.
>
> > > > rails 2.1.1
> > > > ruby1.8.6
> > > >ruby-debug-0.10.3
>
> > > > Eric
>
> > > Where did you put the require statement and where did you put the
> > > debugger method for instance?
>
> > > --
> > > Video training screencasts athttp://www.digiprof.fr
> > > --
> > > Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Ruby Debug Not Working

2009-01-18 Thread Eric J

I put require "ruby-debug" at the top of config/environments/
development.rb. I just tried moving it to the bottom of the file and
that didn't seem to help either.

I put the command 'debugger' at the start of one of my controller
methods, so it should hit the controller and then call debugger.



On Jan 18, 7:13 am, Fernando Perez 
wrote:
> Eric J wrote:
> > I installedruby-debugusing this command:
> >   sudo gem installruby-debug-y
>
> > and then added the line to config/environments/development.rb:
> >   require "ruby-debug"
>
> > I restarted webrick and put 'debugger' in my code and tried to access
> > the page with the debugger command, but it didn't do anything. I've
> > tried several times and restarted webrick, to no avail.
>
> > rails 2.1.1
> > ruby1.8.6
> >ruby-debug-0.10.3
>
> > Eric
>
> Where did you put the require statement and where did you put the
> debugger method for instance?
>
> --
> Video training screencasts athttp://www.digiprof.fr
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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
-~--~~~~--~~--~--~---



<    1   2   3   4   >