Ruby on Rails Monday, February 28, 2011

Hi,

Within your view: I would say you need to replace "do |user_comment|"
with something else like "do |u|"

There are no errors in your controller for the new action.

I see you said:

""Show" of User should let you create a
new comment."

Part of the Rails framework is the convention of mapping new the view to
the controller action. Example:
new.html.erb will be mapped to new action in controller
show.html.erb will be mapped to show action in controller.

If you are trying to get your new.html.erb to call the show action in
your controller, then this will be the cause of your error, as in show
action in the controller, you can see that the action is expecting a
UserComment to be there already by finding by id:
UserComment.find(params[:id]).

This will lead to a null error.

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

Ruby on Rails

Quoting Ricardo Gonçalves Dias <ricardogdias@hotmail.com>:
> I have a application that it use view/layout/application.rhtml, in
> this file I have:
>
> <%= render_component :controller => 'car', :action =>'index'%>
>
> But there is one problem, it display this problem: undefined method
> `render_component' for #<#<Class:0xb67e6e48>:0xb67e5f34>
>
> How can I resolve this problem?
>

IIRC, components have been deprecated since 2.0. There may be a gem or plugin
to provide backwards compatibility (that may not have been updated for Rails
3). But, if it were me, I'd update to more modern idioms.

Jeffrey

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

Ruby on Rails

I was running 2.3.8, but one thing that sucks about using 2.3.8 is that
I cannot write sophisticated using RSpec2. Which is why I am migrating
to 3.0.4.

So, if you would like to have good unit tests (using RSpec2), I would
recommend moving to Rails 3.

Best,
Radhesh

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

Ruby on Rails

Hi experts,

I recently moved to Rails 3.0.4, and tried doing 'rails plugin install
https://github.com/parasew/acts_as_tree.git', but vendor/plugins/ is
empty.

I tried with the --force option, but the plugin still does not get
installed.

Am I missing something here?

Best,
Radhesh

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

Ruby on Rails

Hi,

I am developing a rails 3 application.
I want to use a interceptor before delivering emails.
If a conditions meets, I want to stop the email.
How do I do that?

Thanks.

Sam

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

Ruby on Rails

One option would be to put it in the controller. You can simply check the dates and create an instance variable containing an error message. That isn't very DRY though. Want to do it somewhere else? Then you're duplicating the code.

Another option is to create a dummy model that does not inherit from ActiveRecord, then include the validations there. If you add the right methods, you can interact with it just like a normal AR model. Something like this should get you started:

class MySearchClass

  include ActiveModel::Validations

  validates :start_date
  validates :end_date

  def save

    return false unless valid?
    # the dates were valid, go ahead and query the records
    return true
  end

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

Ruby on Rails

I'm trying to get a validation error to appear on my form.  I'm adding the error to my model inside of a method called from a 'before_add' association callback (see prevent_user_from_having_more_than_one).  From what I understand about Association Callbacks, you raise an exception so that you trigger a database rollback so the invalid data is reversed out of the database.  And that works for me...it will not let me associate more than one group to a user with a role of 'user'.


The problem is that I can't get that error to show up in the view (on the form) even though I explicitly set the error on the model in that :before_add method.  So what am I doing wrong?  Thanks for any help.

https://gist.github.com/847748

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

Ruby on Rails

I have an app that has been around a while that I'm migrating for
Rails 2.3.8. There have been a lot of interesting issues, but I'm on
the home stretch, but have now run into some very odd errors.

The gist is when I run a task with rake it fails, but when I run the
same code form the console it works fine. The 'fix' I devised was to
move my include ModuleNameA, include ModuleNameB, etc to the bottom of
the AR file.

I don't like this 'fix' as I don't understand it. Before I moved them
the AR object (we will call it Bob) kept throwing undefined method
errors when it was called through the rake invocation. It was invoked
in the rake task, but in another AR object.

So the rake task was running something like Worker.work, and it would
fail as described above. When I run Worker.work from the console it
would pass. Once I moved the includes to the bottom of the file both
would work.

Anyone ever seen anything like this? I feel like something
fundamental isn't correct. Like I have broken something basic to the
functionality and my 'fix' is some kind of weird patch.

thanks.
Erik

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

Ruby on Rails

Form level validation involving enforcing a relation between two or
more form inputs that may not even be in the model:

I am building a form that will query a range of records between two
dates.

The form ask for a starting data and a ending date.

I want to validate that the user selected a starting data before or
equal to the ending date.

It seems that this validation should happen in the controller, rather
than in the model.

If it should happen in the model, what would be an example?

( a more complex, but maybe idea way would be to do the validation for
this in javascript in the client browser?)

Or if it makes since in the controller, how do I do validation in the
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hello all,

I'm having a problem setting up the Rails Installer package under
Windows - when IRB has been fired up, it seems to zap the default
keyboard mappings which breaks the backspace function.

It's appearing in the console as what I think is a Crtl-D character -
or at least, it's displaying as <-[D. IRB also seems to have lost the
Crtl-H backspace mapping as well, although both are working fine
outside of the IRB console.

Has anyone come across this - or even better, come across a fix?

TIA, Tim

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

Ruby on Rails

David, that was IT!  Thank you very much.

Works beautifully now.

On Mon, Feb 28, 2011 at 10:54 AM, David J. Hamilton <groups@hjdivad.com> wrote:
Excerpts from dana tassler's message of Sun Feb 27 17:37:20 -0800 2011:
> I'm looking to display my current git branch in the bash prompt.
>
> I can come close by following these instructions, but it does not
> display the branch.  http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/
>
> Would any of you happen to know how to do this?

The above tries to run git-symbolic-ref.  On Ubuntu you'd want git symbolic-ref
(i.e. without the first -).

--
med vänlig hälsning
David J. Hamilton

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




--

"One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies."

- C.A.R. Hoare, in talking about designing software.

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

Ruby on Rails

Excerpts from dana tassler's message of Sun Feb 27 17:37:20 -0800 2011:
> I'm looking to display my current git branch in the bash prompt.
>
> I can come close by following these instructions, but it does not
> display the branch. http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/
>
> Would any of you happen to know how to do this?

The above tries to run git-symbolic-ref. On Ubuntu you'd want git symbolic-ref
(i.e. without the first -).

--
med vänlig hälsning
David J. Hamilton

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

Ruby on Rails

ken bob wrote in post #984481:> has anyone any idea on how to distribute
a BLACKBERRY APPLICATION
> ( i.e .jad and .cod files)
> using rails? I would want a little example on how to achieve this on
> heroku.

I don't think this is going to have anything to do with Rails. If you
can figure out how to do it with anything else it will work exactly the
same in Rails.

Do you have a specific question about this that directly involves Rails?
If not then it would probably be better to direct your question to a
Blackberry developer forum.

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

Ruby on Rails

On 28 February 2011 15:55, frankblizzard <tmaximini@googlemail.com> wrote:
> the problem is that the client made already a 3-year-payment for this
> hoster :-/
> in general the hoster looks great, it is just this issue with rails3
> not being supported yet..
> but i think i can upgrade to at least 2.3.8, like colin pointed out.

You want the latest, is it 2.3.11? There was a recent security fix.

Colin

>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I have a application that it use view/layout/application.rhtml, in
this file I have:

<%= render_component :controller => 'car', :action =>'index'%>

But there is one problem, it display this problem: undefined method
`render_component' for #<#<Class:0xb67e6e48>:0xb67e5f34>

How can I resolve this problem?

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

Ruby on Rails

Hi every body,

I use rest web service in my rails application for user's
authentication (user creation, login, ...)
Can someone explain me, how can i call a REST Web service (not
developped in Rails, and deployed by Tomcat) in my rails application
via POST method.

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

Ruby on Rails

Bonjour,

Après plusieurs tentatives sans succès, je fais appel à votre aide.
J'ai une application Rails qui pour gérer l'authentification des
utilisateurs (création login, etc) , utilise un REST Web Service (qui
n'est pas en ruby on rails, déployé avec Tomcat).

Je voudrais savoir quelle est la démarche à suivre et comment faire
appel au web service dans mon controller User en Ruby on Rails.

Merci d'avance de votre aide.

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

Ruby on Rails

the problem is that the client made already a 3-year-payment for this
hoster :-/
in general the hoster looks great, it is just this issue with rails3
not being supported yet..
but i think i can upgrade to at least 2.3.8, like colin pointed out.

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

Ruby on Rails

On Feb 28, 3:27 pm, Michael Baldock <li...@ruby-forum.com> wrote:
> Thanks for your help!
>
> >  =band_form.label "Select from saved Bands"
> >  =collection_select(band, :saved_band_name, @bands, :band_name,
> > :band_name, {:selected => @selected_band})
>
> That first argument to collection_select should be the name of the
> attribute, ie a symbol or string rather than an actual instance of
> band. The easy way would be to use the form builder, ie
> band_form.collection_form :saved_band_name, ... just like you're doing
> with other form inputs.
>
> ---------------
>
> I really didn't know I could use collection select in this way, thanks
> for the tip, not quite sure how it's working, but
>
> band_form.collection_select :saved_band_name, @bands, :band_name,
> :band_name, {:selected => @selected_band}
>

It's exactly the same as band_form.text_field. The form builder object
(ie band_form) encapsulates the object being edited & info about the
appropriate prefix for the input names.

Fred

> seems to be passing the selected band name through exactly as it should
> be :-))
>
> --
> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi,

has anyone any idea on how to distribute a BLACKBERRY APPLICATION
( i.e .jad and .cod files)
using rails? I would want a little example on how to achieve this on
heroku.

Regards
Ken

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

Ruby on Rails

Thanks for your help!

> =band_form.label "Select from saved Bands"
> =collection_select(band, :saved_band_name, @bands, :band_name,
> :band_name, {:selected => @selected_band})

That first argument to collection_select should be the name of the
attribute, ie a symbol or string rather than an actual instance of
band. The easy way would be to use the form builder, ie
band_form.collection_form :saved_band_name, ... just like you're doing
with other form inputs.

---------------

I really didn't know I could use collection select in this way, thanks
for the tip, not quite sure how it's working, but

band_form.collection_select :saved_band_name, @bands, :band_name,
:band_name, {:selected => @selected_band}

seems to be passing the selected band name through exactly as it should
be :-))

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

Ruby on Rails

On 28 February 2011 13:37, frankblizzard <tmaximini@googlemail.com> wrote:
> Hi,
>
> I am still quite new to rails and now I have to do a project for a
> client. She has her hosting a hostgator and they use cpanel as admin
> panel.
> The problem is that cpanel is not compatible with rails 3, the actual
> installed version there is 2.3.5
> Is it a bad idea to still start a 2.3.x application or is it "nearly
> the same"...

I believe 2.3.5 has some serious security issues. It should at least
be upgraded to 2.3.latest. The fact that the hoster has not made at
least the latest 2.3 available suggests they are not serious about
Rails. Better to move to one that is, heroku for example.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I have a short-term contract position opening for a technical writer.
The position is telecommute and is probably a week to 2 weeks worth of
work at full time. Part-time can be accommodated. Pay rate is
negotiable. If you're experienced and interested, please contact me
at bill at shopkeep dot com.

Thanks,
Bill

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

Ruby on Rails

On Mon, Feb 28, 2011 at 6:57 AM, dana tassler <dana.tassler@gmail.com> wrote:

> The time displays, as does the working directory.  They are also both
> color-coded.  However, the current branch does not show (as I did initially
> mention).
>
> I'm not on OS X but instead Ubuntu 10.04.

Yes, I missed that, as the subject line was truncated - perhaps
better to put it in the email body :-)

On OS X:

07:02 ~ $ cd projects/current
07:02 ~/projects/current (user_customer)$ git-symbolic-ref
usage: git-symbolic-ref [-q] [-m <reason>] name [ref]
07:06 ~/projects/current (user_customer)$

On Ubuntu 10.4
07:05 ~/projects/testcase $ git branch
* master
07:05 ~/projects/testcase $ git-symbolic-ref
git-symbolic-ref: command not found
07:05 ~/projects/testcase $

That would seem to be the main problem. Anyway, this probably is
OT here, but feel free to send follow-up questions to me directly :-)

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I should have been clearer.

The time displays, as does the working directory.  They are also both color-coded.  However, the current branch does not show (as I did initially mention).

I'm not on OS X but instead Ubuntu 10.04.

On Mon, Feb 28, 2011 at 8:53 AM, Hassan Schroeder <hassan.schroeder@gmail.com> wrote:
On Sun, Feb 27, 2011 at 5:37 PM, dana tassler <dana.tassler@gmail.com> wrote:
> I'm looking to display my current git branch in the bash prompt.
>
> I can come close by following these instructions, but it does not
> display the branch.  http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/

What does "come close" mean? The above directions worked exactly
as expected for me on OS X (10.6.6).

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--

"One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies."

- C.A.R. Hoare, in talking about designing software.

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

Ruby on Rails

On Sun, Feb 27, 2011 at 5:37 PM, dana tassler <dana.tassler@gmail.com> wrote:
> I'm looking to display my current git branch in the bash prompt.
>
> I can come close by following these instructions, but it does not
> display the branch.  http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/

What does "come close" mean? The above directions worked exactly
as expected for me on OS X (10.6.6).

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Why don't you try other hosting services like heroku.com and
hostingrails.com

I think hostingrails.com is currently rates #1 ruby hosting service in
blogs I read.

On Feb 28, 7:19 pm, Jazmin <jazminschroe...@gmail.com> wrote:
> I would recommend to try to find a work around, specially because you will
> be starting a new project, the rails community is quickly migrating
> gems/plugins to rails 3 and pretty soon new gems will not offer backward
> compatibility.
>
> Explore the options with the hosting provider.
>
> Good luck!

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

Ruby on Rails



On Mon, Feb 28, 2011 at 4:26 PM, Karthikeyan <mindaslab@gmail.com> wrote:
Hello Group,

I want to start a project that uses Rails 3 and ruby 1.9.2 . with
(Rmagick). Can any one tell me a Linux distro that supports these
software seamlessly?

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


I used rvm to install on CentOS (on my desktop), so far the ride has been very smooth.  I am not sure about Rmagick.

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

Ruby on Rails

I would recommend to try to find a work around, specially because you will be starting a new project, the rails community is quickly migrating gems/plugins to rails 3 and pretty soon new gems will not offer backward compatibility.


Explore the options with the hosting provider.

Good luck!

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

Ruby on Rails

I am using Ubuntu and I have rvm. Working great so far!! no problems at all..





On Mon, Feb 28, 2011 at 4:56 AM, Karthikeyan <mindaslab@gmail.com> wrote:
Hello Group,

I want to start a project that uses Rails 3 and ruby 1.9.2 . with
(Rmagick). Can any one tell me a Linux distro that supports these
software seamlessly?

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




--
Jazmin

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

Ruby on Rails

Definitely use RVM as this simplifies the experience. Remember to
amend your .bashrc file and then your golden to install ruby as well
rails.

-
All the best
Angus | http://www.shuntyard.co.za/ (en)

On Feb 27, 3:54 am, Mitin Rai <mitin...@gmail.com> wrote:
> Hi
>
> I have installed Ubuntu 10.04 on my lenova. Tried installing ruby through
> synaptic package manager. I am unable to run ruby,rails commands through
> command prompt..
>
> can anyone suggest the best way to install ruby on rails on ubuntu and also
> the suggested versions...
>
> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

If this is related to a personal development box I would say whatever
Linux distro you are happy that also meets your personal app
requirements and preferences. Rails run very well (and for all
intensive purposes is equally easy to install) on all of the major
Linux distros. So personally I would choose a distro based on what I
need and like and then lastly is rails compatible. For me that's
Ubuntu as I found the most help online when starting out in term of
howtos and blog post etc.

For pure server based production deployment I have CentOS and Ubuntu
on the top of my list

-
All the best
Angus | http://www.shuntyard.co.za/ (en)


On Feb 28, 3:11 pm, Culley Smith <culley.sm...@gmail.com> wrote:
> I recommend using rvm to install ruby and rails.  That way, whatever distro
> you use, you will be able to control your RoR installations.  I've tested
> RoR on Ubuntu, Arch Linux, Debian, and Fedora.  Of these, I ran into the
> most problems with Ubuntu.  I got things working just fine eventually, but
> Ubuntu had the most unmet dependencies and quirks.  This was using fresh
> installs of the most recent versions of each, but Ubuntu had older versions
> of some necessary packages, complicating things.
>
> So, using rvm on any of these installations should bypass many headaches you
> run into with differences in local versions.
>
> Culley
>
>
>
>
>
>
>
> On Mon, Feb 28, 2011 at 6:16 AM, radhames brito <rbri...@gmail.com> wrote:
>
> > On Mon, Feb 28, 2011 at 6:56 AM, Karthikeyan <mindas...@gmail.com> wrote:
>
> >> Hello Group,
>
> >> I want to start a project that uses Rails 3 and ruby 1.9.2 . with
> >> (Rmagick). Can any one tell me a Linux distro that supports these
> >> software seamlessly?
>
> > I have only used ubuntu and unbuntu server and all work flawlessly, I have
> > more problem on macosx than in ubuntu, because not everything i need is
> > found in Homebrew.
>
> > --
> > 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+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi,

I am still quite new to rails and now I have to do a project for a
client. She has her hosting a hostgator and they use cpanel as admin
panel.
The problem is that cpanel is not compatible with rails 3, the actual
installed version there is 2.3.5
Is it a bad idea to still start a 2.3.x application or is it "nearly
the same"...
like more a problem in my head than it really is...
meaning should i try to find a workaround to get v 3.x running or just
learn 2.3 as well...?

thanks for your opinions

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

Ruby on Rails

My tutorial could help you! http://cicolin.blogspot.com/2010/10/how-to-install-ruby-rails-and.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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I don't know what's Rmagick, but maybe my little guide could help you: http://cicolin.blogspot.com/2010/10/how-to-install-ruby-rails-and.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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

The same error here...On Ubuntu 10.10


And when I run "rails server" it says "=> Rails 3.0.4 application starting in development on http://0.0.0.0:3000 " instead of 3.0.5, is it normal?

Thanks, byyye!

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

Ruby on Rails

I recommend using rvm to install ruby and rails.  That way, whatever distro you use, you will be able to control your RoR installations.  I've tested RoR on Ubuntu, Arch Linux, Debian, and Fedora.  Of these, I ran into the most problems with Ubuntu.  I got things working just fine eventually, but Ubuntu had the most unmet dependencies and quirks.  This was using fresh installs of the most recent versions of each, but Ubuntu had older versions of some necessary packages, complicating things.

So, using rvm on any of these installations should bypass many headaches you run into with differences in local versions. 

Culley

On Mon, Feb 28, 2011 at 6:16 AM, radhames brito <rbritom@gmail.com> wrote:


On Mon, Feb 28, 2011 at 6:56 AM, Karthikeyan <mindaslab@gmail.com> wrote:
Hello Group,

I want to start a project that uses Rails 3 and ruby 1.9.2 . with
(Rmagick). Can any one tell me a Linux distro that supports these
software seamlessly?


I have only used ubuntu and unbuntu server and all work flawlessly, I have more problem on macosx than in ubuntu, because not everything i need is found in Homebrew.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails



On Mon, Feb 28, 2011 at 6:56 AM, Karthikeyan <mindaslab@gmail.com> wrote:
Hello Group,

I want to start a project that uses Rails 3 and ruby 1.9.2 . with
(Rmagick). Can any one tell me a Linux distro that supports these
software seamlessly?


I have only used ubuntu and unbuntu server and all work flawlessly, I have more problem on macosx than in ubuntu, because not everything i need is found in Homebrew.

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

Ruby on Rails



On Mon, Feb 28, 2011 at 7:58 AM, Karthikeyan <mindaslab@gmail.com> wrote:
What about Rmagick / imagemagickl? It needs to be compiled natively.
Will it work smoothly with RVM?


sometimes rvm is unable to properly point at some libraries/binary in your system and wont be able to use , for example , readline because it was not where it expecting it to be, you can then install it with it own version like this

rvm install 1.9.2 --with-readline-dir=$rvm_path/usr


this can also happen with other system dependencies but there is always a solution at rvm's site so there is no real reason to worry.


imagemagick is bit one of those libraries rvm or ruby need to work so there is no problem with them as long as they are well installed in your system.

@Mitin Rai

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

Ruby on Rails

What about Rmagick / imagemagickl? It needs to be compiled natively.
Will it work smoothly with RVM?

On Feb 27, 7:05 pm, radhames brito <rbri...@gmail.com> wrote:
> > Is there any advantage using rvm?
>
> in ruby, as in many languages you can have conflict between libraries, also
> since rails and ruby are open, gems came from everywhere so is hard to keep
> and eye on versions, another problem is that rails changes very fast because
> the community is very engaged and active, all this causes a problem, your
> libraries change often, so if lets say you have one project his week  using
> a certain  gem version maybe by next week when you are going to make a new
> project you can use a newer version of you favorite gem, but you soon notice
> there is a conflict since the new gem is not backwards compatible and cant
> be use in the old project or now it only works with a previous version of
> ruby and you old proyect needs a huge port to make the leap. All this could
> be a problem is there was no rvm, rvm creates a separated environment for
> every ruby you install and you can also have gemsets which isolate gems into
> folder that you can assign to each project, so now you can have
>
> rvm use ruby1.8.7@gemsold
>
> for the old project and
>
> rvm user ruby1.9.2@gemsnew
>
> for the new proyect and never worry about a conflict again.

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

Ruby on Rails



On 28 February 2011 02:37, dana tassler <dana.tassler@gmail.com> wrote:
I'm looking to display my current git branch in the bash prompt.

If you are using zsh, take a look at "oh my zsh" : https://github.com/robbyrussell/oh-my-zsh

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

Ruby on Rails

http://www.google-melange.com/document/show/gsoc_program/google/gsoc2011/timeline

This is the link.


On Feb 28, 9:20 am, "kondor...@gmail.com" <kondor...@gmail.com> wrote:
> Hi Guys, there will be someone who want to submit application to
> Google for new Google summer of code (Google melange:http://www.google-melange.com/document/show/gsoc_program/google/gsoc2...
> I'm a student, and I want to participate :)

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

Ruby on Rails

Hello Group,

I want to start a project that uses Rails 3 and ruby 1.9.2 . with
(Rmagick). Can any one tell me a Linux distro that supports these
software seamlessly?

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

Ruby on Rails

On 28 February 2011 01:37, dana tassler <dana.tassler@gmail.com> wrote:
> I'm looking to display my current git branch in the bash prompt.

Probably best to ask on a Git list... sure lots of Rails users are Git
users, but all Git list subscribers are :-)

http://groups.google.com/group/git-users

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

Ruby on Rails

thanks for this
its serious learning and programing of ror from myside...
anymore suggestions

On Mon, Feb 28, 2011 at 8:17 AM, radhames brito <rbritom@gmail.com> wrote:


On Sun, Feb 27, 2011 at 10:38 PM, Mitin Rai <mitinrai@gmail.com> wrote:
do i need this if i am new to ror and developing my first project in ror.


If you are doing the project to learn rails then no, if its a serious project you must use rvm.

obviously you should first install it in a virtual machine and see what it is about. If this is your first project and you are just learning is not mandatory, but you have to put rvm in the list of things to learn if you are serious about programing rails applications. 

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

ahhh brilliant. Thanks for that.

I did something a bit similar but had all the folder names in an arry
getting passed in. But that was a bit messy looking. So your solution
works a treat.

Thanks for your help.

Kind regards,
Usman Hussain

On Feb 26, 5:07 am, "t.pickett66" <t.picket...@gmail.com> wrote:
> On Feb 25, 8:54 am, Usman Hussain <usmanhhuss...@gmail.com> wrote:
>
> > Hi Guys,
> > I would like to require a set of *.rb files into my test.
> > But the problem is they sit in sub-directories. So i end up with a
> > whole list of require statements.
>
> > If i am doing something like this:
> > Dir["lib/config/*.rb"].each {|file| require file }
> > Dir["lib/common/*.rb"].each {|file| require file }
> > Dir["lib/page/*.rb"].each {|file| require file }
>
> > lib is common so is there a way I can turn those three statements into
> > just one line of code?
>
> > So that it looks like something like this:
> > Dir["lib/*/*.rb"].each {|file| require file }
>
> This will require every file in lib and its subdirectories:
> files = File.join(File.dirname(__FILE__),'..','lib','**','*.rb')
> Dir.glob(files).each do |file|
>   require file
> end
>
> If you must have it as a one liner (a little harder to read imho):
> Dir.glob(File.join(File.dirname(__FILE__),'..','lib','**','*.rb')).each{|
> file| require file}
>
> This assumes you're keeping your directory structure organized
> something like:
> |~project_root/
> | |~lib/
> | | |+config/
> | | |+common/
> | | |+page/
> | |~test/
> | | |-test.rb
>
> -T

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

Ruby on Rails

On 28 February 2011 04:01, Bhasker Harihara <harihara.bhasker@gmail.com> wrote:
>
>
> On Sat, Feb 26, 2011 at 10:12 PM, Colin Law <clanlaw@googlemail.com> wrote:
>>
>> On 26 February 2011 14:31, Mauro <mrsanna1@gmail.com> wrote:
>> > I know it's a good practice setting attr_accesible for models.
>> > As an example if I have a model with admin: boolean attribute and if I
>> > don't set attr_accessible, a user can do: put /users/17?admin=1 making
>> > user 17 an admin.
>> > But if I have attr_accessible set and I want to create new users with
>> > a html form, how can I set admin true or false?
>> > I have to do an update directly in the database?
>>
>> You don't need a separate operation on the db.  In create or update in
>> the controller, before you call save or update_attributes, then set
>> the admin attribute if appropriate.
>>
>> Colin
>>
> Is it good practice to do in the models or in controllers.
>
> If it is models then all sorts of validations go in place.

To do exactly what in the model or controller? Presumably the
decision about whether a user is admin or not is made in a controller
action. You can then set @user.admin = true before saving, or you
could call a model method @user.set_admin(true). It is up to you
which you prefer.

Colin

>
> 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+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi Guys, there will be someone who want to submit application to
Google for new Google summer of code (Google melange:
http://www.google-melange.com/document/show/gsoc_program/google/gsoc2011/timeline)?
I'm a student, and I want to participate :)


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

Ruby on Rails Sunday, February 27, 2011

No worries :)

On 25-2-2011 18:18, binu wrote:
> Thanks Mark and Oto. Sorry had been busy working on something else.
> Mark I don't need any fancy web standards. Its just the 3rd party tool
> that
> will be accessing my application using SOAP services.
> Note: My application is already up and running using REST.
>
> I did try using some actionwebservice gems like rubyjedi and
> datanoise.
> Thing is that when I create a new controller in my current app using
> soap. It gives me routes error. And i am not able to figure out
> next steps.
>
> Thanks
>
> On Feb 18, 2:11 pm, Mark Kremer<m...@without-brains.net> wrote:
>> soap4r hasn't had a release since September 2007
>> (http://rubygems.org/gems/soap4r), so that might not be the best option.
>>
>> If you don't need any fancy WS-standards then you could also simply
>> create a controller for it and render the appropriate XML responses
>> yourself.
>>
>> On 18-2-2011 9:17, Oto Brglez wrote:
>>
>>
>>
>>> Hi!
>>> I suggest you look at soap4r. Here you will find "Geting started
>>> guide":
>>> http://markthomas.org/2007/09/12/getting-started-with-soap4r/
>>> - Oto
>>> On 17 feb., 21:20, binu<agarwal.bin...@gmail.com> wrote:
>>>> I have an existing restful rails application. I need to add a new API.
>>>> This new API will be used bySOAPclient to access the application.
>>>> It will be really helpful if someone can guide me or point me to the
>>>> useful links.
>>>> After googling for few days I do know we can use actionwebservice gem
>>>> along with many other gem.
>>>> If someone can give me more information on thesoaproutes in rails
>>>> that will be awesome.
>>>> Thanks in advance
>>>> Binesh

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

Ruby on Rails

Use google?

http://www.ruby-forum.com/topic/149431

On Sun, Feb 27, 2011 at 8:50 PM, Mallika Kamat <lists@ruby-forum.com> wrote:
I'm new to rails and i want to use mysql with rails 3.0.5 on windows 7.
When I run the command
rake db:create
I get a pop up box saying that SQLite3.dll is missing.

What should I do?

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




--

"One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies."

- C.A.R. Hoare, in talking about designing software.

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

Ruby on Rails

I'm looking to display my current git branch in the bash prompt.

I can come close by following these instructions, but it does not
display the branch. http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/

Would any of you happen to know how to do this?

Thank you much.

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

Ruby on Rails

Sorry for the noob question but I am trying to convert a text_field to a
select_tag and although I don't get an error, the "active" param does
not pass.

This code passes does not pass the "active" param in the select_tag:
<% form_for :project do |f| -%>
<label for= "name">Project Name</label>
<%= f.text_field :name %>
<label for= "active">Active</label>
<%= select_tag "active", options_for_select( ["Yes", "No"] )%>
<%= submit_tag 'Submit' %>
<%= form_tag %>
<% end -%>

This code passes DOES pass the "active" param in the text_field:
<% form_for :project do |f| -%>
<label for= "name">Project Name</label>
<%= f.text_field :name %>
<label for= "active">Active</label>
<%= f.text_field :active %>
<%= submit_tag 'Submit' %>
<%= form_tag %>
<% end -%>

Can anyone point out where I'm going wrong?
thanks
atomic

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

Ruby on Rails



On Mon, Feb 28, 2011 at 6:48 AM, Mauro <mrsanna1@gmail.com> wrote:
Do you use ajax live searching?
With rails 2 I had used observe_field.
Now in rails 3 with unobtrusive javascript it can be used jquery and
onkeyup event, but I don't like keyup, on every key I press there is a
database search, it's too expensive.
What solutions do you adopt?


I use this jquery plugin plus ajax.

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




--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails



On Mon, Feb 28, 2011 at 3:53 AM, Erwin <yves_dufour@mac.com> wrote:
I was happy too  quickly ...

I actually need to produce a structure like this ( to be used with
Mongoid DB criteria )

{ "$in" => [tags[0]], "$in" =>[tags[1]] , ....}


you can't. a hash should have unique keys.
 
I may have to use a json structure ?



On 27 fév, 20:16, Erwin <yves_duf...@mac.com> wrote:
> given an Arra tags[]
>
> I need to produce a resulting Hash as following ..
>
> { "$in" => [tags[0]], "$in" =>[tags[1], ...}
>
> in which the key should be always the same and the value being an
> Array
>
> I tried this :
>
>          myHash = {}
>          tags.each do |tag|
>            h = {"$in" => [tag]}
>            myHash.merge!(h)
>          end
>
> but the merge! is only  changing the value ...  (as the key is always
> the same ..)
> (there is no += as with Array class  ...)
>
> thanks for your feedback

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




--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails



On Sun, Feb 27, 2011 at 1:14 PM, Hassan Schroeder <hassan.schroeder@gmail.com> wrote:
On Sat, Feb 26, 2011 at 6:14 AM, Alex Katebi <alex.katebi@gmail.com> wrote:
> Neither, go with the external authentication omniauth gem. People don't like
> to register to any web sites. They like to use their existing accounts.

That seems like a pretty sweeping statement, especially without any
context as to a given site's audience.

It doesn't appear to me that omniauth offers an alternate local account
authentication method, which means that if a user doesn't use any of
your offered providers (or prefers not to), s/he's out of luck.

Not really. The user can still click on a provider icon and signup right there. It is better to offload authentication to the main stream sites. I don't see a reason for providing a fifth wheel :). Let's face it. No one wants to fill out another registration form and compromise their password or worst remember yet another password.

 
Something to consider.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Do you use ajax live searching?
With rails 2 I had used observe_field.
Now in rails 3 with unobtrusive javascript it can be used jquery and
onkeyup event, but I don't like keyup, on every key I press there is a
database search, it's too expensive.
What solutions do you adopt?

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

Ruby on Rails

Excellent catch. I extended my local list of unusual inflections in
config/initializers.

ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'media', 'medias'
inflect.irregular 'missive', 'missives'
inflect.irregular 'criterion', 'criteria'
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Thanks fred .. found how to do it....
there is a specific criteria for it ( I did not fully understand when
reading it the first time...)

Criteria#all_in:
Matches if all values provided match, useful for doing exact matches
on arrays.

so writing :
criteria.all_in(:tags => tags ).to_a

did it ...

I'll try to give an eye to the underlaying Mongoid ruby code in charge
of doing that ....

On 27 fév, 21:49, Frederick Cheung <frederick.che...@gmail.com> wrote:
> On Feb 27, 7:56 pm, Erwin <yves_duf...@mac.com> wrote:
>
> > this is to be used with MongoID as a criteria
>
> > criteria.where(:tags => { "$in" => [tags[0]], "$in"
> > =>[tags[1]] }).to_a
>
> > any suggestion with json structure ?
>
> You can't repeat keys in a json hash either. What are you actually
> trying to do?
>
> Fred
>
>
>
>
>
>
>
>
>
> > On 27 fév, 19:47, Frederick Cheung <frederick.che...@gmail.com> wrote:
>
> > > On Feb 27, 6:29 pm, Erwin <yves_duf...@mac.com> wrote:
>
> > > > given an Arra tags[]
>
> > > > I need to produce a resulting Hash as following ..
>
> > > > { "$in" => [tags[0]], "$in" =>[tags[1], ...}
>
> > > > in which the key should be always the same and the value being an
> > > > Array
>
> > > By definition, a hash stores a single value for a given key. The
> > > closest you'll get is to make the value an array of all the things for
> > > the key in question.
>
> > > 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I need to write a Mongoid criteria

criteria.where(:tags => myStruct ).to_a

in which myStruct will have this structure { "$in" =>
[check_tags[0]], "$in" =>[check_tags[1]] , .. }
built from a check_tags Array

it's a sequence of .in criteria
I am checking if ALL of the elements of check_tags[] are included in a
Mongoid record Array field :tags

the simplest Mongoid criteria:
criteria.in(:tags => tags)
just perform a checking on ANY element included, not ALL

On 27 fév, 21:49, Frederick Cheung <frederick.che...@gmail.com> wrote:
> On Feb 27, 7:56 pm, Erwin <yves_duf...@mac.com> wrote:
>
> > this is to be used with MongoID as a criteria
>
> > criteria.where(:tags => { "$in" => [tags[0]], "$in"
> > =>[tags[1]] }).to_a
>
> > any suggestion with json structure ?
>
> You can't repeat keys in a json hash either. What are you actually
> trying to do?
>
> Fred
>
>
>
>
>
>
>
>
>
> > On 27 fév, 19:47, Frederick Cheung <frederick.che...@gmail.com> wrote:
>
> > > On Feb 27, 6:29 pm, Erwin <yves_duf...@mac.com> wrote:
>
> > > > given an Arra tags[]
>
> > > > I need to produce a resulting Hash as following ..
>
> > > > { "$in" => [tags[0]], "$in" =>[tags[1], ...}
>
> > > > in which the key should be always the same and the value being an
> > > > Array
>
> > > By definition, a hash stores a single value for a given key. The
> > > closest you'll get is to make the value an array of all the things for
> > > the key in question.
>
> > > 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Thanks all.
The output of gem env is:

RubyGems Environment:
- RUBYGEMS VERSION: 1.5.3
- RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [x86_64-
darwin10.6.0]
- INSTALLATION DIRECTORY: /usr/local/ruby1.9/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/ruby1.9/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/ruby1.9/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /usr/local/ruby1.9/lib/ruby/gems/1.9.1
- /Users/magnus_vb/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

It looks for a newbie like me alright (except the "1.9.1". Should it
not be 1.9.2 ?). So, I did a "gem install rails". Then restarted
Terminal, did a "bundle update". And.. Yes! Now it is using Ruby
1.9.2 :=)

Many, many thanks
Magnus

On Feb 27, 6:22 pm, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On Feb 27, 9:59 am, Magnusvb <mag...@studioalice.se> wrote:
>
>
>
> > Hi
> > I have installed Ruby 1.9.2 and upgraded Rails to 3.0.4 (Mac OS X
> > 10.6). Running "ruby -v" this is the output:
> > ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0]
>
> > Running "which ruby", the output is:
> > /usr/local/ruby1.9/bin/ruby
>
> > The problem is then I'm starting the WEBrick server with "rails
> > server":
> > [2011-02-27 10:56:13] INFO  WEBrick 1.3.1
> > [2011-02-27 10:56:13] INFO  ruby 1.8.7 (2009-06-12) [universal-
> > darwin10.0]
> > [2011-02-27 10:56:13] INFO  WEBrick::HTTPServer#start: pid=21069
> > port=3000
>
> > Why is Ruby 1.8.7 used, and what to do to have WEBrick using Ruby
> > 1.9.2 instead?
>
> I'd guess that you have both ruby 1.8.6 and 1.9.2 installed, both are
> on the path but you've only installed the rails gem for ruby 1.8.7, so
> while 'ruby' finds 1.9.2, running 'rails' finds the one installed with
> ruby 1.8.7. If you install rails in your ruby 1.9.2 environment you
> should be ok.
>
> Fred
>
>
>
> > Best regards,
> > Magnus

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

Ruby on Rails

I am trying to figure out the best way to handle caching in a fairly
unique scenario. I've read through the various caching posts, but
nothing really matches what I am trying to do.

Let's assume there are two models, company and site, and each has a
string (short_name) that will be used for routing. So we can do
either of the following:
http(s)://{company.short_name}.{mydomain}.com/{site.short_name}, or
http(s)://{mydomain}.com/{company.short_name}/{site.short_name}

Both of these are mapped to a single controller and action that
figures out what to render based on the various attributes in the
models. But, once it renders, I'd like to cache the content if the
site is set to use caching. I'd like to cache the action rather than
the site if the site requires authentication. And in some cases, no
caching should be used. When I try to do this in my controller
action, a page gets cached, but it's empty and it isn't used. If I do
this after I render the view, the page does get written to the cache,
but then rails is not picking it up and still performs all the logic
then re-writes to the cache. Is there any way around this?

if @site.cache_page?
unless @site.requires_authentication?
cache_page
else
cache_action
end
end

I realize that normally one would cache the action in the class def,
but I can't really do that, since I don't want to always return the
cached page anytime that action is called in the controller, and I
don't want to have to have a controller and action for every site.

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