rubyonrailsin

A Ruby and Rails talk

Tuesday, March 23, 2010

Re: [Rails] How to move ruby from /usr/bin/ to /usr/local/bin/ on OSX Snow leopard 10.6

by rubyonrailsin 0 comments
On Tue, Mar 23, 2010 at 1:25 PM, Peter <Peterorpete@me.com> wrote:
Hi i'm a beginner to ruby on rails and I am trying to start a tutorial
but having trouble making sure ruby is in the right place. When i use
the terminal and ask "which ruby" it comes back with  /usr/bin/ whilst
I think i needs it to be in usr/local/bin but i don't know how to get
it there. There is not even a bin folder in the local area at present.
I am following these up to date installation instructions
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard
but still can't get it in the local folder. ANy help would be very
grateful.

Regards Peter


Peter, if you're talking about moving the system installed Ruby, I would recommend
against this action because this is installed by the OS.  Also, you do not know what
service(s) depends on it.  However, I would recommend using Ruby Version Manager 
(RVM) to manage your Ruby installations.  Thus, you can find more information about
RVM here:


Good luck,

-Conrad
 
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.
Read More…

[Radiant-Dev] Re: default translations for i18n

by rubyonrailsin 0 comments
At first I wasn't sure this was a good idea, but the more I think
about it, the more I like it. I usually only have two languages,
anything more just confuses things. My users only expect German and
English and most of them don't even know the panel is there. They just
want to be able to read it.

I wouldn't leave the language selection out, if only just to point out
that it actually there. It would be far to easy for it to be forgotten
and lost if you actually had to set a preference to show it.

And just for fun Klingon is my standard testing language.

Keith

Keith Bingman
http://keithbingman.com

On Mar 23, 7:28 pm, banane <ban...@gmail.com> wrote:
> Jive! Pig Latin!
>
> > I anxiously await submissions for translations in Esperanto, bork bork bork, and LOLcats.
>
> > -Jim

--
Radiant CMS Dev Mailing List
Post: radiantcms-dev@googlegroups.com
Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com
Group Site: http://groups.google.com/group/radiantcms-dev/

To unsubscribe from this group, send email to radiantcms-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Read More…

[Rails] Re: redirection in format.json ...

by rubyonrailsin 0 comments
Lasse Bunk wrote:
> Here is an example:
>
> format.json { render :json => { :redirect => requests_url } }
>
> and then on your client redirect like this:
>
> if (json.redirect) {
> window.location = json.redirect;
> }
>
> Also try http://www.google.com/search?q=json+redirect
>
> Does this solve your problem?
>
> /Lasse
>
> 2010/3/23 Erwin <yves_dufour@mac.com>

thanks for your help

it seems that json.redirect is bypassed...
I put an alert, and it's not fired up

if (json.redirect) {
alert('redirect');
}
--
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.

Read More…

[Rails] has_many_polymorphs with searchlogic

by rubyonrailsin 0 comments
Has anyone been able to use searchlogic with has_many_polymorphs?
Are they compatible?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Re: [Rails] redirection in format.json ...

by rubyonrailsin 0 comments
Here is an example:

  format.json { render :json => { :redirect => requests_url } }

and then on your client redirect like this:

  if (json.redirect) {
    window.location = json.redirect;
  }

Also try http://www.google.com/search?q=json+redirect

Does this solve your problem?

/Lasse

2010/3/23 Erwin <yves_dufour@mac.com>
I  have presently a render :json which modify the current page

     if @request.save
        format.html { redirect_to(@request) }
       format.json { render :json => { :result => 'success', :request
=> request_path(@request) } }
....

but I would like rather to redirect to an index page
I wrote this but it doesn't redirect ...

       format.json { redirect_to requests_url }

what should I write to redirect correctly  to an html page ?

thanks for your help

erwin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.
Read More…

[Rails] Re: Simple Backup???

by rubyonrailsin 0 comments
Thanks Andy and ayupmeduck...

Yes, this was the issue (Sorry, I'm mostly a LAMP guy, this was
probably pretty obvious to Rails developers)... In our clean scripts
we were running a command to create a new Rails project before we
restored. I got rid of this and started with a clean folder and
everything works great now.

Thanks again!

On Mar 23, 1:08 am, Andy Jeffries <andyjeffr...@gmail.com> wrote:
> On 20 March 2010 00:33, nshenry03 <nshenr...@gmail.com> wrote:
>
> > I am simply trying to backup a ruby on rails app... I have created an
> > archive of the entire database and application folders on server A...
> > I then restore the database and application folders on server B....
>
> > Server B is exactly the same as A (same OS, same ruby, gems, etc...)
>
> > However when I go to the site on server B, all I see is:
>
> > Welcome aboard
> > You're riding Ruby on Rails!
>
> If you see that message, then you still have a public/index.html file which
> should have been gone a long time ago!
>
> Delete that (or rename it) and then see what error you get.
>
> Cheers,
>
> Andy

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] Upcoming app > Research and Prep

by rubyonrailsin 0 comments
Hey everyone.

I'm a one person team and in the next month need to produce and deploy
an application. I've been playing with rails for a little over a year
now and recently deployed my first app as a private contract.

I'm now planning development on a start up company.

The app should be expecting high volumes (not like Twitter but high
for sure. Its no social media app) My target audience is very specific
but in certain locals the app has been requested by many users who are
in fact waiting for the app to deploy.

Smaller Volumes actually uploading files and adding objects to the db.
Many people surfing the site. (Probably the same sort of RATIOS as
cragslist (posters:readers, but not near the volume.)

My current plan is and I need some help with this:

Start on shared hosting unlimited traffic/storage. Will move to
dedicated-virtual if shared hosting causes performance issues when
traffic picks up.
Behavior Drive Development via RSpec & Cucumber.
Build the App in rails with ActiveRecord (I read somewhere
ActiveRecord can be swapped out for something faster, Should I use
something else?)
Use multiple MySQL databases 1 master for writing, at *least* 2 slaves
for reading. (Any info on this would be good.)
Run multiple mongrel instances via mongrel_cluster. (How many is
sufficient? I think currently I have 4 available on my hosting, can
upgrade later if needed. So that would be 1 main instance and 3
extras.)
Paypal via Active_Merchant for all payment processing. (May accept
money order and check but that's not app related.)
Amazon S3 services for file/image upload & hosting (Via paperclip.) I
may start by hosting all images from local server as I have unlimited
space but I feel as the app grows my hosting may not appreciate the
traffic and I'll move to Amazon S3.
Deploy via Git & Capistrano

I'm going to do all the base functionality for the application myself.
Get it running get people signed up get them using the app. Hopefully
the multiple db's and mongrel instances should supply enough speed to
start. At which point if everything goes as planned (it never does)
I'll outsource and get added security. Get queries optimized and work
on overall performance via back end processes etc that will be over my
head for sure hence the outsource or hire of private team. I know at
this point it will be necessary to do these things and costs for such
have been accounted for.

Any help with gathering resources where I can find more information
about the above topics or personal experiences would be greatly
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Read More…

Re: [Rails] Sorting forum topics by the most recent replies

by rubyonrailsin 0 comments
On 3/23/2010 2:56 PM, DanC wrote:
> I have built a simple forum but am having difficult getting the topics
> to display in the order of their latest reply.
>
> The associations are as follows:
>
> class Forum< ActiveRecord::Base
> has_many :topics, :order => "sticky DESC, created_at DESC"
> has_many :replies, :through => :topics
>
> class Topic< ActiveRecord::Base
> belongs_to :forum
> has_many :replies, :order => "created_at", :dependent => :destroy
>
> class Reply< ActiveRecord::Base
> belongs_to :topic
>
> And in my controller I am calling @topics = @forum.topics
>
> What I would like to do is sort the topics by the created_at of their
> most recent posts.
>
> Any advice appreciated.
>
Add a last_reply_at field to Topic. Add a after_save to Reply that
updates last_reply_at. When you find all topics sort by last_reply_at.
> Thanks,
>
> Dan
>
>


--
Jack Christensen
jackc@hylesanderson.edu

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[spree-user] Re: resource_controller vs. inherited_resources

by rubyonrailsin 0 comments
+1 for this concern.
personally I find the r_c code being DRY at the cost of being not very
readable - A case where I feel more code is better than less.

On Mar 23, 9:41 pm, Michael Guterl <mgut...@gmail.com> wrote:
> 2010/3/23 Jack Lynch <speedyj...@gmail.com>:
>
> > Would it be practical at all to use neither in some situations?
>
> > My reason for asking is that I remember initially finding the controller
> > code within Spree completely baffling.  I'm still not sure I get r_c, but
> > *my impression* of these controller frameworks is that they help achieve DRY
> > code in basic controllers that are backed by one model.  However Spree has
> > some more complex controllers, rhe checkouts controller in particular
> > orchestrates a few models (Order, Checkout, others?) and IMO might be easier
> > to maintain if vanilla Rails code was used instead.
>
> > So, use i_r or r_c in simple scenarios, and live with more lines of code in
> > others for a readability/maintainability benefit?
>
> I have shared a similar opinion in the past and I still agree.
>
> Best,
> Michael Guterl

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

Read More…

Re: [Rails] :has_many and :controller specified in routes.rb

by rubyonrailsin 0 comments
Maybe you could use:

map.resources :buckets, :controller => 'v1/buckets' do |buckets|
  buckets.resources :apples, :controller => 'v1/apples'
end

I know this is a bit more code than just using :has_many, but I don't think :has_many lets you specify a different controller.

/Lasse

2010/3/23 gsw <garysweaver@gmail.com>
Have an app using older version of Rails (2.3.2) that I need some
routing assistance with if anyone has a minute.

The app was originally designed to be purely html view, and an xml and
json api was hacked on. To keep it clean, we are now moving the first
version of the api (v1) under its own directory (v1) under app/
controllers but still responding to the old paths.

One of the parts of the new routes.rb specifies:
map.resources :buckets, :has_many => :apples, :controller => 'v1/
buckets'

However, when I do rake routes, this produces:
...
buckets           GET /buckets(.:format) {:controller=>"v1/
buckets", :action=>"index"}
                 POST /buckets(.:format) {:controller=>"v1/
buckets", :action=>"create"}
new_bucket        GET /buckets/new(.:format) {:controller=>"v1/
buckets", :action=>"new"}
edit_bucket       GET /buckets/:id/edit(.:format) {:controller=>"v1/
buckets", :action=>"edit"}
bucket            GET /buckets/:id(.:format) {:controller=>"v1/
buckets", :action=>"show"}
                 PUT /buckets/:id(.:format) {:controller=>"v1/
buckets", :action=>"update"}
                 DELETE /buckets/:id(.:format) {:controller=>"v1/
buckets", :action=>"destroy"}
bucket_apples     GET /buckets/:bucket_id/apples(.:format)
{:controller=>"apples", :action=>"index"}
                 POST /buckets/:bucket_id/apples(.:format)
{:controller=>"apples", :action=>"create"}
new_bucket_apple  GET /buckets/:bucket_id/apples/new(.:format)
{:controller=>"apples", :action=>"new"}
edit_bucket_apple GET /buckets/:bucket_id/apples/:id/edit(.:format)
{:controller=>"apples", :action=>"edit"}
bucket_apple      GET /buckets/:bucket_id/apples/:id(.:format)
{:controller=>"apples", :action=>"show"}
                 PUT /buckets/:bucket_id/apples/:id(.:format)
{:controller=>"apples", :action=>"update"}
                 DELETE /buckets/:bucket_id/apples/:id(.:format)
{:controller=>"apples", :action=>"destroy"}
...
(sorry for the bad formatting)

Notice that the routes for the actions specific to the model
referenced by :has_many ignores the specification of the controller
(they go to :controller=>"apples" instead of :controller=>"v1/
apples").

Sorry for the n00b routing question. I didn't find such an example of
how to set the controller of the :has_many referenced model yet, but
maybe it is an option somewhere, or I could setup another route for
that?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+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.
Read More…

Re: [Rails] Re: NoMethodError in AdminController#index

by rubyonrailsin 0 comments
On 23 March 2010 20:14, dwhitekiss <dwhitekiss@gmail.com> wrote:
> I still get the same errors when I did option 1

The error you had before was, from your first post,
NoMethodError in AdminController#index

undefined method `scaffold' for AdminController:Class

Are you saying you still get that error, and with the trace below?

Colin

>
> /home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/
> scaffolding.rb:107:in `list'
> /home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/
> scaffolding.rb:95:in `index'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> base.rb:1331:in `send'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> base.rb:1331:in `perform_action_without_filters'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> filters.rb:617:in `call_filters'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> filters.rb:610:in `perform_action_without_benchmark'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> benchmarking.rb:68:in `perform_action_without_rescue'
> /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
> core_ext/benchmark.rb:17:in `ms'
> /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
> /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
> core_ext/benchmark.rb:17:in `ms'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> benchmarking.rb:68:in `perform_action_without_rescue'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> rescue.rb:160:in `perform_action_without_flash'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> flash.rb:146:in `perform_action'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> base.rb:532:in `send'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> base.rb:532:in `process_without_filters'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> filters.rb:606:in `process'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> base.rb:391:in `process'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> base.rb:386:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> routing/route_set.rb:437:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> dispatcher.rb:87:in `dispatch'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> dispatcher.rb:121:in `_call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> dispatcher.rb:130:in `build_middleware_stack'
> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> query_cache.rb:29:in `call'
> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> query_cache.rb:29:in `call'
> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> connection_adapters/abstract/query_cache.rb:34:in `cache'
> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> query_cache.rb:9:in `cache'
> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> query_cache.rb:28:in `call'
> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> connection_adapters/abstract/connection_pool.rb:361:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> string_coercion.rb:25:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:
> 24:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> params_parser.rb:15:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> session/cookie_store.rb:93:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> failsafe.rb:26:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
> `synchronize'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> dispatcher.rb:114:in `call'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> reloader.rb:34:in `run'
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> dispatcher.rb:108:in `call'
> /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in
> `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
> /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:
> 17:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:
> 13:in `call'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:
> 50:in `service'
> /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
> /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
> /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
> /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
> /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
> /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
> /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
> /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
> /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
> /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
> /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:
> 14:in `run'
> /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
> script/server:3
>
>
>
> On Mar 23, 3:43 pm, Luke Pearce <li...@ruby-forum.com> wrote:
>> Top link in google:
>>
>> http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/...
>>
>> Read the replies about scaffolding basically you'll need to install the
>> scaffolding gem:
>>
>> From a command prompt in your app root:
>>
>> ruby script/plugin install scaffolding
>>
>> or install a previous version of rails (if you are working through a
>> book it's probably a good idea to use the same version it uses)
>>
>> gem install rails -v="1.2.3"
>>
>> For simplicities sake probably just uninstall your current rails version
>> (gem uninstall rails) first then install the older version; that way
>> you'll know the rails commands are running the correct version.
>>
>> Cheers
>> Luke
>> --
>> 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.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Re: [Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

by rubyonrailsin 0 comments
On Tue, 2010-03-23 at 12:38 -0700, Justin wrote:
> Michael,
>
> Thanks SO much for helping me. I still haven't gotten the logs to
> populate, even with root:www-data
>
> No luck with your chown -R root:www-data testapp1
> If restarted apache: /etc/init.d/apache2 restart
> * Restarting web server apache2
> ... waiting ...done.
>
> My symbolic link:
> $ cd /var/www
> $ ls -l
> lrwxrwxrwx 1 root www-data 31 2010-03-21 07:55 testapp1 -> /home/
> justinschier/www/testapp1
>
> My home www folder:
> $ cd /home/justinschier
> $ ls -l
> drwxrwxrwx 3 root www-data 4096 2010-03-20 08:02 www
>
> My testapp1 folder:
> $ cd /home/justinschier/www
> $ ls -l
> drwxrwxrwx 13 root www-data 4096 2010-03-20 08:02 testapp1
>
> My log folder:
> $ cd /home/justinschier/www/testapp1
> $ ls -l
> ...
> drwxrwxrwx 2 root www-data 4096 2010-03-20 08:02 log
> ... (everything's the same permissions and ownership as log)
>
> My log files:
> -rwxrwxrwx 1 root www-data 1676 2010-03-22 20:58 development.log
> -rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 production.log
> -rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 server.log
> -rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 test.log
>
> I know the development.log is showing now, BUT that's because I tried
> running WebBrick. That's why there's something in there.
>
>
> My /public folder (no .htaccess file):
> $ cd /home/justinschier/www/testapp1/public
> $ ls -al
> drwxrwxrwx 5 root www-data 4096 2010-03-22 08:21 .
> drwxrwxrwx 13 root www-data 4096 2010-03-20 08:02 ..
> -rwxrwxrwx 1 root www-data 947 2010-03-20 08:02 404.html
> -rwxrwxrwx 1 root www-data 930 2010-03-20 08:02 422.html
> -rwxrwxrwx 1 root www-data 948 2010-03-20 08:02 500.html
> -rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 favicon.ico
> drwxrwxrwx 2 root www-data 4096 2010-03-20 08:02 images
> -rwxrwxrwx 1 root www-data 7466 2010-03-20 08:02 index.html
> drwxrwxrwx 2 root www-data 4096 2010-03-20 08:02 javascripts
> -rwxrwxrwx 1 root www-data 204 2010-03-20 08:02 robots.txt
> drwxrwxrwx 3 root www-data 4096 2010-03-22 15:30 stylesheets
>
>
> Still when I run this, the log files don't grow at all:
> http://testapp1.fuse.sonikserver.com/
> Welcome Aboard Page loads correctly
>
> http://testapp1.fuse.sonikserver.com/rails/info/properties
> and I still get "We're sorry, but something went wrong"
>
> Apache has instances running as both root and www-data:
> $ ps aux | grep apache2
> root 14157 0.0 0.3 141016 8040 ? Ss 12:24 0:00 /usr/
> sbin/apache2 -k start
> root 14170 0.0 0.0 23192 1888 ? Sl 12:24 0:00 /var/
> lib/gems/1.8/gems/passenger-2.2.11/ext/apache2/
> ApplicationPoolServerExecutable 0 /var/lib/gems/1.8/gems/
> passenger-2.2.11/bin/passenger-spawn-server /usr/bin/ruby1.8 /tmp/
> passenger.14157
> www-data 14175 0.0 0.2 141492 6036 ? S 12:24 0:00 /usr/
> sbin/apache2 -k start
> www-data 14176 0.0 0.2 141348 5812 ? S 12:24 0:00 /usr/
> sbin/apache2 -k start
> www-data 14177 0.0 0.2 141348 5812 ? S 12:24 0:00 /usr/
> sbin/apache2 -k start
> www-data 14178 0.0 0.2 141476 5796 ? S 12:24 0:00 /usr/
> sbin/apache2 -k start
> www-data 14179 0.0 0.2 141476 5924 ? S 12:24 0:00 /usr/
> sbin/apache2 -k start
> www-data 14183 0.0 0.2 141476 5852 ? S 12:24 0:00 /usr/
> sbin/apache2 -k start
> www-data 14188 0.0 0.2 141016 4692 ? S 12:25 0:00 /usr/
> sbin/apache2 -k start
> root 14206 0.0 0.0 7340 884 pts/0 S+ 12:27 0:00 grep
> apache2
>
>
> I even got rid of the symbolic link (above) and no change:
>
> $ vi /etc/apache2/sites-available/default
>
> Now reads:
>
> ... default part ommitted for this post ....
>
> LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.11/
> ext/apache2/mod_passenger.so
> PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.11
> PassengerRuby /usr/bin/ruby1.8
>
> <VirtualHost *:80>
> ServerName testapp1.fuse.sonikserver.com
> DocumentRoot /home/justinschier/www/testapp1/public
> <Directory /home/justinschier/www/testapp1/public>
> Allow from all
> Options -MultiViews
> </Directory>
> </VirtualHost>
>
> Man, I am so out of ideas. Anything else you can think of for me to
> try?
>
> Thanks again SOOO much. If you have an Amazon wish list, I'm totally
> buying you something.
----
log files are written by rails as the 'user', not by the apache user.
See the directory listing of my 'logs' below.

Apache user is www-user anyway, not root. Root user is only for the
master process.

you should change the ownership back on all files/folders
in /home/justinscheier/www/testapp1

Then, you need to indicate in your apache configuration which RailsEnv
is to be used...

<VirtualHost *:80>
ServerName testapp1.fuse.sonikserver.com
DocumentRoot /home/justinschier/www/testapp1/public
## note the following line ##
RailsEnv production # or development if that's what you are running
##
<Directory /home/justinschier/www/testapp1/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>

Passenger is very clever and can be forced to restart just by issuing the command (as user), 'touch tmp/restart.txt'

On my setups (RH/CentOS/Fedora), apache is both user and group and apache web server runs as user:group apache:apache

thus...
drwxrwxr-x 3 craig apache 4096 2010-03-21 03:17 log
drwxrwxr-x 7 craig apache 4096 2010-03-06 01:23 tmp

note: apache group on both folders and group permissions are rwx (or chmod 775 log tmp)

also, inside tmp...
$ ls -l tmp/
total 16
drwxrwxr-x 3 craig apache 4096 2010-02-09 02:58 cache
drwxrwxr-x 3 craig apache 4096 2010-02-09 02:58 pids
-rw-rw-r-- 1 craig craig 0 2010-03-23 00:12 restart.txt
drwxrwxr-x 3 craig apache 4096 2010-02-09 02:58 sessions
drwxrwxr-x 3 craig apache 4096 2010-02-09 02:58 sockets

the only places you should even think about changing ownership (log & tmp) and even then, just the group bits, not the user.

root is used nowhere.

The other thing you have to make certain of, is that if you are running apache from your home directory, that the apache user (in your case, www-data) can actually access.

so ls -ld /home /home/justinscheier /home/justinscheier/www /home/justinscheier/www/testapp1 must all be 'o+x' so the web server user can access.

** log files (with logrotate handling weekly rotation, development log only updates when I run script/console)
$ ls -l log
total 23932
-rw-r--r-- 1 craig craig 9546293 2010-03-19 22:29 development.log
-rw-r--r-- 1 craig craig 1052394 2010-03-23 20:07 production.log
-rw-r--r-- 1 craig craig 4943853 2010-02-28 03:21 production.log-20100228
-rw-r--r-- 1 craig craig 2694898 2010-03-07 03:38 production.log-20100307
-rw-r--r-- 1 craig craig 2908919 2010-03-14 03:33 production.log-20100314
-rw-r--r-- 1 craig craig 3306385 2010-03-21 03:17 production.log-20100321

Craig


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Re: [Rails] Fixtures and Associations

by rubyonrailsin 0 comments
On 23 March 2010 18:05, David Ishmael <lists@ruby-forum.com> wrote:
> I have a concrete table with an associated join table and I'm trying to
> load up some test data but cannot seem to get the fixtures file correct.
> The parent/child relationship works great but the fixtures fail to load.
> Any help would be greatly appreciated.
>
> Here is what I have...
>
> # app/models/node.rb
> class Node < ActiveRecord::Base
>  belongs_to :category
>  belongs_to :status
>
>  has_one  :parents,

Why is that not has_one :parent ?

>           :class_name => "NodeGroup",
>           :foreign_key => "child_id"
>
>  has_one  :parent, :through => :parents

That would only work if there were a relationship to a parents table

>
>  has_many :children,
>           :class_name => "NodeGroup",
>           :foreign_key => "parent_id"
>
> end
>
> # app/models/node_group.rb
> class NodeGroup < ActiveRecord::Base
>  belongs_to :parent, :class_name => "Node"
>  belongs_to :child, :class_name => "Node"
> end
>
> # test/fixtures/nodes.yml

Should be node_groups.yml

> parent1:
>  name: Parent1
>  children: child1

I would have expected this to be
parent: Parent1
child: child1

Colin

>
> parent2:
>  name: Parent2
>
> child1:
>  name: Child1
> --
> 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.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] How to move ruby from /usr/bin/ to /usr/local/bin/ on OSX Snow leopard 10.6

by rubyonrailsin 0 comments
Hi i'm a beginner to ruby on rails and I am trying to start a tutorial
but having trouble making sure ruby is in the right place. When i use
the terminal and ask "which ruby" it comes back with /usr/bin/ whilst
I think i needs it to be in usr/local/bin but i don't know how to get
it there. There is not even a bin folder in the local area at present.
I am following these up to date installation instructions
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard
but still can't get it in the local folder. ANy help would be very
grateful.

Regards Peter

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

Read More…

[Rails] Re: NoMethodError in AdminController#index

by rubyonrailsin 0 comments
I still get the same errors when I did option 1

/home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/
scaffolding.rb:107:in `list'
/home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/
scaffolding.rb:95:in `index'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:1331:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:1331:in `perform_action_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
filters.rb:617:in `call_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
filters.rb:610:in `perform_action_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
rescue.rb:160:in `perform_action_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
flash.rb:146:in `perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:532:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:532:in `process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
filters.rb:606:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:391:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:386:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
routing/route_set.rb:437:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:87:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:121:in `_call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:130:in `build_middleware_stack'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/query_cache.rb:34:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:9:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:28:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:361:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
string_coercion.rb:25:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:
24:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
params_parser.rb:15:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
session/cookie_store.rb:93:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
failsafe.rb:26:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
`synchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:114:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
reloader.rb:34:in `run'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:108:in `call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:
17:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:
13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:
50:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:
14:in `run'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
script/server:3

On Mar 23, 3:43 pm, Luke Pearce <li...@ruby-forum.com> wrote:
> Top link in google:
>
> http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/...
>
> Read the replies about scaffolding basically you'll need to install the
> scaffolding gem:
>
> From a command prompt in your app root:
>
> ruby script/plugin install scaffolding
>
> or install a previous version of rails (if you are working through a
> book it's probably a good idea to use the same version it uses)
>
> gem install rails -v="1.2.3"
>
> For simplicities sake probably just uninstall your current rails version
> (gem uninstall rails) first then install the older version; that way
> you'll know the rails commands are running the correct version.
>
> Cheers
> Luke
> --
> 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.

Read More…

[Rails] Sorting forum topics by the most recent replies

by rubyonrailsin 0 comments
I have built a simple forum but am having difficult getting the topics
to display in the order of their latest reply.

The associations are as follows:

class Forum < ActiveRecord::Base
has_many :topics, :order => "sticky DESC, created_at DESC"
has_many :replies, :through => :topics

class Topic < ActiveRecord::Base
belongs_to :forum
has_many :replies, :order => "created_at", :dependent => :destroy

class Reply < ActiveRecord::Base
belongs_to :topic

And in my controller I am calling @topics = @forum.topics

What I would like to do is sort the topics by the created_at of their
most recent posts.

Any advice appreciated.

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

Read More…

Re: [Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

by rubyonrailsin 0 comments
On 23 March 2010 19:38, Justin <soniknewmedia@gmail.com> wrote:
> Michael,
>
> Thanks SO much for helping me. I still haven't gotten the logs to
> populate, even with root:www-data

Justin,

I don't know what you're so impressed with me for... we've not sorted
your problem. And I'm afraid I pretty much out of ideas, I'm afraid
:-(

It's bugging me, because I had the *same* issue a couple of weeks ago
(log files not being written to), although my application was working.
But I can't remember what was the thing that fixed it, and I'm not at
home to look to see if I made any notes.

Just looking through your post again; if you delete the log files, do
they get created by Apache? And what does the tail of the Apache log
say?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

by rubyonrailsin 0 comments
Michael,

Thanks SO much for helping me. I still haven't gotten the logs to
populate, even with root:www-data

No luck with your chown -R root:www-data testapp1
If restarted apache: /etc/init.d/apache2 restart
* Restarting web server apache2
... waiting ...done.

My symbolic link:
$ cd /var/www
$ ls -l
lrwxrwxrwx 1 root www-data 31 2010-03-21 07:55 testapp1 -> /home/
justinschier/www/testapp1

My home www folder:
$ cd /home/justinschier
$ ls -l
drwxrwxrwx 3 root www-data 4096 2010-03-20 08:02 www

My testapp1 folder:
$ cd /home/justinschier/www
$ ls -l
drwxrwxrwx 13 root www-data 4096 2010-03-20 08:02 testapp1

My log folder:
$ cd /home/justinschier/www/testapp1
$ ls -l
...
drwxrwxrwx 2 root www-data 4096 2010-03-20 08:02 log
... (everything's the same permissions and ownership as log)

My log files:
-rwxrwxrwx 1 root www-data 1676 2010-03-22 20:58 development.log
-rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 production.log
-rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 server.log
-rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 test.log

I know the development.log is showing now, BUT that's because I tried
running WebBrick. That's why there's something in there.


My /public folder (no .htaccess file):
$ cd /home/justinschier/www/testapp1/public
$ ls -al
drwxrwxrwx 5 root www-data 4096 2010-03-22 08:21 .
drwxrwxrwx 13 root www-data 4096 2010-03-20 08:02 ..
-rwxrwxrwx 1 root www-data 947 2010-03-20 08:02 404.html
-rwxrwxrwx 1 root www-data 930 2010-03-20 08:02 422.html
-rwxrwxrwx 1 root www-data 948 2010-03-20 08:02 500.html
-rwxrwxrwx 1 root www-data 0 2010-03-20 08:02 favicon.ico
drwxrwxrwx 2 root www-data 4096 2010-03-20 08:02 images
-rwxrwxrwx 1 root www-data 7466 2010-03-20 08:02 index.html
drwxrwxrwx 2 root www-data 4096 2010-03-20 08:02 javascripts
-rwxrwxrwx 1 root www-data 204 2010-03-20 08:02 robots.txt
drwxrwxrwx 3 root www-data 4096 2010-03-22 15:30 stylesheets


Still when I run this, the log files don't grow at all:
http://testapp1.fuse.sonikserver.com/
Welcome Aboard Page loads correctly

http://testapp1.fuse.sonikserver.com/rails/info/properties
and I still get "We're sorry, but something went wrong"

Apache has instances running as both root and www-data:
$ ps aux | grep apache2
root 14157 0.0 0.3 141016 8040 ? Ss 12:24 0:00 /usr/
sbin/apache2 -k start
root 14170 0.0 0.0 23192 1888 ? Sl 12:24 0:00 /var/
lib/gems/1.8/gems/passenger-2.2.11/ext/apache2/
ApplicationPoolServerExecutable 0 /var/lib/gems/1.8/gems/
passenger-2.2.11/bin/passenger-spawn-server /usr/bin/ruby1.8 /tmp/
passenger.14157
www-data 14175 0.0 0.2 141492 6036 ? S 12:24 0:00 /usr/
sbin/apache2 -k start
www-data 14176 0.0 0.2 141348 5812 ? S 12:24 0:00 /usr/
sbin/apache2 -k start
www-data 14177 0.0 0.2 141348 5812 ? S 12:24 0:00 /usr/
sbin/apache2 -k start
www-data 14178 0.0 0.2 141476 5796 ? S 12:24 0:00 /usr/
sbin/apache2 -k start
www-data 14179 0.0 0.2 141476 5924 ? S 12:24 0:00 /usr/
sbin/apache2 -k start
www-data 14183 0.0 0.2 141476 5852 ? S 12:24 0:00 /usr/
sbin/apache2 -k start
www-data 14188 0.0 0.2 141016 4692 ? S 12:25 0:00 /usr/
sbin/apache2 -k start
root 14206 0.0 0.0 7340 884 pts/0 S+ 12:27 0:00 grep
apache2


I even got rid of the symbolic link (above) and no change:

$ vi /etc/apache2/sites-available/default

Now reads:

... default part ommitted for this post ....

LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.11/
ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/bin/ruby1.8

<VirtualHost *:80>
ServerName testapp1.fuse.sonikserver.com
DocumentRoot /home/justinschier/www/testapp1/public
<Directory /home/justinschier/www/testapp1/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>

Man, I am so out of ideas. Anything else you can think of for me to
try?

Thanks again SOOO much. If you have an Amazon wish list, I'm totally
buying you something.

Justin

On Mar 23, 6:16 am, Michael Pavling <pavl...@gmail.com> wrote:
> On 23 March 2010 09:57, Michael Pavling <pavl...@gmail.com> wrote:
>
> > On 22 March 2010 14:11,Justin<soniknewme...@gmail.com> wrote:
> >> I didn't know about www-data, but your suggestion still didn't work.
>
> I just checked a server I have here (Ubuntu9.04LTS) and the directory
> ownership is slightly different to what I said.
> I've got it as:
> chown -R root.www-data my_rails_app
>
> Also worth checking the permissions of the log folder, and if there's
> log files in there, check their perms - delete them if necessary and
> see if the app recreates them once all the ownership is set.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Re: [Rails] Re: How do I set defaults for view parameters?

by rubyonrailsin 0 comments
On Tue, Mar 23, 2010 at 12:43 PM, Colin Law <clanlaw@googlemail.com> wrote:
> On 23 March 2010 16:31, Robin Ting <civ2boss@gmail.com> wrote:
>> I don't, but I figure there must be a way to just have it in the
>> controllers. Oh well thanks, I'll start another thread.
>
> You don't what?  It is best to insert your reply at the appropriate
> point in the comment so that it is easier to follow the thread.  If
> you mean that you don't have the .:format in the route where you are
> using some_url.csv then that is the problem.

hmm yeah that's what I meant. Thanks I think I figured it out.

This is the code I will use in the routes.rb file:
map.admin 'admin.:format', :controller => 'user_sessions', :action => 'admin'

> Colin
>
>>
>> On Tue, Mar 23, 2010 at 12:17 PM, Colin Law <clanlaw@googlemail.com> wrote:
>>> On 23 March 2010 16:03, Robin Ting <civ2boss@gmail.com> wrote:
>>>> Yeah thanks for the help!
>>>>
>>>> By the way do you know how I can get the "format.csv { render :csv =>
>>>> @logs }" part to work? I have tested it on an index page and that
>>>> works, but when I try it on this admin page it says it doesn't
>>>> understand the URL. I have set a direct path to the admin page instead
>>>> of the standard "controller/action" path in the routes.rb file, but
>>>> even if i go through the "controller/action" path it still says it
>>>> can't find it. Is it because of that direct path in the routes.rb that
>>>> it's giving me the error?
>>>
>>> Have you got the .:format bit in the route?  Otherwise I would suggest
>>> a new thread for this question as routing is not my high point.
>>>
>>> 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.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] redirection in format.json ...

by rubyonrailsin 0 comments
I have presently a render :json which modify the current page

if @request.save
format.html { redirect_to(@request) }
format.json { render :json => { :result => 'success', :request
=> request_path(@request) } }
....

but I would like rather to redirect to an index page
I wrote this but it doesn't redirect ...

format.json { redirect_to requests_url }

what should I write to redirect correctly to an html page ?

thanks for your help

erwin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Re: [Radiant-Dev] default translations for i18n

by rubyonrailsin 0 comments
Jive! Pig Latin!

>
> I anxiously await submissions for translations in Esperanto, bork bork bork, and LOLcats.
>
> -Jim
>

--
Radiant CMS Dev Mailing List
Post: radiantcms-dev@googlegroups.com
Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com
Group Site: http://groups.google.com/group/radiantcms-dev/

To unsubscribe from this group, send email to radiantcms-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Read More…

[Rails] Re: submit form in popup and send value back to the main page

by rubyonrailsin 0 comments
I added some javascript to the create.html.erb template that opens in
the popup after the document form submits.
The javascript is supposed to close the popup and send the title of
the document back to the main page but it's not working. Anyone know
why?


this is what is in the create.html.erb template:

<script type="text/javascript">

function copyData(){
var docField = window.opener.document.getElementById('title');
docField.setValue('<%=h @doc.title %>');
this.close();
}

copyData();

</script>

On Mar 23, 6:06 pm, ES <emsto...@gmail.com> wrote:
> I made a popup within object1's form to show another form to create a
> new document object to associate with object1.  When I click the
> submit button I want
> 1) the document object to be created
> 2) the popup to close
> 3) the value in the document "title" field to get added to the
> document name field in object1's form.
>
> I've made the form for the document object in the popup but I'm having
> trouble figuring out the logic for 2) and 3).  I'd imagine I have to
> use javascript to close the popup and send the title back to the main
> page.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Radiant-Dev] default translations for i18n

by rubyonrailsin 0 comments
We recently merged in the i18n branch which provides translation of the admin interface.
By default we have dutch, french, german, italian, japanese and russian: http://github.com/radiant/radiant/tree/master/vendor/extensions

I've opted to only load English by default
http://github.com/radiant/radiant/blob/master/lib/generators/instance/templates/instance_environment.rb#L24

But I would like to hear arguments against that if there are any.

My thought was that the language packs are not totally complete and a majority of current sites would not need additional languages, so providing the option should be available to those that need it.
And I'm considering the idea of leaving the language selection out as well, but allow those that need it to turn it on.

What do you think? Should all bundled languages be there by default? Is that interface noise?
Is there an expectation that selecting languages be available by your users?

And, of course, how many and what languages should be there by default? If 10 community members each submit a new translation, should we bundle them all or encourage a separate extension?

I anxiously await submissions for translations in Esperanto, bork bork bork, and LOLcats.

-Jim

Jim Gay
http://www.saturnflyer.com


--
Radiant CMS Dev Mailing List
Post: radiantcms-dev@googlegroups.com
Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com
Group Site: http://groups.google.com/group/radiantcms-dev/

To unsubscribe from this group, send email to radiantcms-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Read More…

[Rails] Fixtures and Associations

by rubyonrailsin 0 comments
I have a concrete table with an associated join table and I'm trying to
load up some test data but cannot seem to get the fixtures file correct.
The parent/child relationship works great but the fixtures fail to load.
Any help would be greatly appreciated.

Here is what I have...

# app/models/node.rb
class Node < ActiveRecord::Base
belongs_to :category
belongs_to :status

has_one :parents,
:class_name => "NodeGroup",
:foreign_key => "child_id"

has_one :parent, :through => :parents

has_many :children,
:class_name => "NodeGroup",
:foreign_key => "parent_id"

end

# app/models/node_group.rb
class NodeGroup < ActiveRecord::Base
belongs_to :parent, :class_name => "Node"
belongs_to :child, :class_name => "Node"
end

# test/fixtures/nodes.yml
parent1:
name: Parent1
children: child1

parent2:
name: Parent2

child1:
name: Child1
--
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.

Read More…

[Rails] Re: Rails 3 + Different ORM

by rubyonrailsin 0 comments
Well, ignore that.

Rails does autoloading quite a bit differently that I expected and it
appears my stuff is getting loaded. *grimace*

On Mar 23, 10:13 am, cult hero <binarypala...@gmail.com> wrote:
> I'm migrating an old project (not Rails) over to Rails 3. I've been
> using Sequel as my ORM and I'm quite happy with it. However, when I
> add Sequel models to my app/model directory, they don't seem to load
> on their own. Am I going to need to load them manually or do I need to
> set some kind of configuration option somewhere?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] Re: Displaying a nested field as a label

by rubyonrailsin 0 comments
That's exactly what I was looking for!

THANK YOU!

And thanks for the insight.

-a

On Mar 23, 12:10 pm, Michael Pavling <pavl...@gmail.com> wrote:
> On 23 March 2010 17:01, andrew <andrew.ggro...@gmail.com> wrote:
>
> > Ahhhh!  a.class = formbuilder.  I thought it was a Comments class.
> > Now I know what to look up....  I guess my question after all is there
> > any way to "extract" a data value from a field within a formbuilder?
> > (if I got my terminology right)
>
> a.object.text
> (although I'm using Formtastic "SemanticFormBuilder" objects here, so
> have fingers crossed the method is the same - dumping "a.methods"
> would help you a little if 'object' doesn't work...)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] Rails 3 + Different ORM

by rubyonrailsin 0 comments
I'm migrating an old project (not Rails) over to Rails 3. I've been
using Sequel as my ORM and I'm quite happy with it. However, when I
add Sequel models to my app/model directory, they don't seem to load
on their own. Am I going to need to load them manually or do I need to
set some kind of configuration option somewhere?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Re: [Rails] Re: Displaying a nested field as a label

by rubyonrailsin 0 comments
On 23 March 2010 17:01, andrew <andrew.ggroups@gmail.com> wrote:
> Ahhhh!  a.class = formbuilder.  I thought it was a Comments class.
> Now I know what to look up....  I guess my question after all is there
> any way to "extract" a data value from a field within a formbuilder?
> (if I got my terminology right)

a.object.text
(although I'm using Formtastic "SemanticFormBuilder" objects here, so
have fingers crossed the method is the same - dumping "a.methods"
would help you a little if 'object' doesn't work...)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] :has_many and :controller specified in routes.rb

by rubyonrailsin 0 comments
Have an app using older version of Rails (2.3.2) that I need some
routing assistance with if anyone has a minute.

The app was originally designed to be purely html view, and an xml and
json api was hacked on. To keep it clean, we are now moving the first
version of the api (v1) under its own directory (v1) under app/
controllers but still responding to the old paths.

One of the parts of the new routes.rb specifies:
map.resources :buckets, :has_many => :apples, :controller => 'v1/
buckets'

However, when I do rake routes, this produces:
...
buckets GET /buckets(.:format) {:controller=>"v1/
buckets", :action=>"index"}
POST /buckets(.:format) {:controller=>"v1/
buckets", :action=>"create"}
new_bucket GET /buckets/new(.:format) {:controller=>"v1/
buckets", :action=>"new"}
edit_bucket GET /buckets/:id/edit(.:format) {:controller=>"v1/
buckets", :action=>"edit"}
bucket GET /buckets/:id(.:format) {:controller=>"v1/
buckets", :action=>"show"}
PUT /buckets/:id(.:format) {:controller=>"v1/
buckets", :action=>"update"}
DELETE /buckets/:id(.:format) {:controller=>"v1/
buckets", :action=>"destroy"}
bucket_apples GET /buckets/:bucket_id/apples(.:format)
{:controller=>"apples", :action=>"index"}
POST /buckets/:bucket_id/apples(.:format)
{:controller=>"apples", :action=>"create"}
new_bucket_apple GET /buckets/:bucket_id/apples/new(.:format)
{:controller=>"apples", :action=>"new"}
edit_bucket_apple GET /buckets/:bucket_id/apples/:id/edit(.:format)
{:controller=>"apples", :action=>"edit"}
bucket_apple GET /buckets/:bucket_id/apples/:id(.:format)
{:controller=>"apples", :action=>"show"}
PUT /buckets/:bucket_id/apples/:id(.:format)
{:controller=>"apples", :action=>"update"}
DELETE /buckets/:bucket_id/apples/:id(.:format)
{:controller=>"apples", :action=>"destroy"}
...
(sorry for the bad formatting)

Notice that the routes for the actions specific to the model
referenced by :has_many ignores the specification of the controller
(they go to :controller=>"apples" instead of :controller=>"v1/
apples").

Sorry for the n00b routing question. I didn't find such an example of
how to set the controller of the :has_many referenced model yet, but
maybe it is an option somewhere, or I could setup another route for
that?

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

Read More…

[Rails] submit form in popup and send value back to the main page

by rubyonrailsin 0 comments
I made a popup within object1's form to show another form to create a
new document object to associate with object1. When I click the
submit button I want
1) the document object to be created
2) the popup to close
3) the value in the document "title" field to get added to the
document name field in object1's form.

I've made the form for the document object in the popup but I'm having
trouble figuring out the logic for 2) and 3). I'd imagine I have to
use javascript to close the popup and send the title back to the main
page.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] Re: How to reference a select_tag within a form

by rubyonrailsin 0 comments
Thanks very much for taking another look at my problem.

> If you want to use RJS then you need
> to use the block form of button_to_function

Here's the best my brain could come up with
<%# = button_to_function("ShowList",
%<page["vendor_droplist"].toggle> ) %>
<%= button_to_function("ShowList")
{ page["vendor_droplist"].toggle } %>
but compilation of new.html.erb with that change gives me:

===
undefined local variable or method `page' for #<ActionView::Base:
0x467eaf4>

Extracted source (around line #17):

14: <%= f.label :vendor %><br />
15: <%= f.text_field :vendor %>
16: <%# = button_to_function("ShowList",
%<page["vendor_droplist"].toggle> ) %>
17: <%= button_to_function("ShowList")
{ page["vendor_droplist"].toggle } %>
18: <br />
19: <div id="vendor_droplist" style="display:none">
20: <%= select_tag "list",
===

If it's not too much trouble, can you point me to website that
provides detail on the alternative forms, or even better, show me a
correct form of #17 above. Sorry for being so obtuse ... I'm a Rails
nubie, but aspiring higher :-)
--
Richard


On Mar 23, 4:11 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On 23 Mar, 07:33, RichardOnRails
>
>
>
> <RichardDummyMailbox58...@USComputerGurus.com> wrote:
> > Hi Frederick,
>
> > As I mentioned to Colin,  I would start a new thread on this question,
> > which is athttp://groups.google.com/group/rubyonrails-talk/tree/browse_frm/threa...
>
> > Thanks for looking into my problem.
>
> > But I just noticed that there is another response on this thread.
>
> > > button_to_function creates a form, which would result in a form nested inside a form, which isn't allowed.
>
> > Wow.  As I mentioned on the other thread,  I posted code on that
> > seemed clean from a Rails perspective and from an HTML perspective.
>
> > So, if button_to_function is inappropriate for forms,  can I specify
> > an image that, when clicked, would toggle a page with the appropriate
> > id specified?  Is there an example on the web that you'd recommend?
>
> Sorry, slight mixup up; button_to creates a form, but looks like
> button_to_remote doesn't. Your javscript fragment is incorrect though
> - the () on a method call aren't optional in javascript, and what
> you've got there looks more like RJS than javascript - the whole
> page[] construct is an RJS-ism. If you want to use RJS then you need
> to use the block form of button_to_function
>
> Fred
>
> > Best wishes,
> > Richard
>
> > BTW, my current code, with HTML generated and Validation results is athttp://www.pastie.org/882256
>
> > On Mar 22, 7:00 pm, Frederick Cheung <frederick.che...@gmail.com>
> > wrote:
>
> > > On Mar 22, 9:18 pm, RichardOnRails<RichardDummyMailbox58...@USComputerGurus.com> wrote:
> > > > It brought up a list of vendor-names immediately under my Vendors
> > > > textbox, which worked great as far as I was concerned.  Then I tried
> > > > to turn it into a real drop-down:
> > > > 1.  I added style="display:none" to the div so that the drop-down was
> > > > hidden when the page opened
> > > > 2.  I added <%= button_to_function("ShowList",
> > > > %<page.toggle :vendor_droplist> ) %> following the text_field
>
> > > > Hiding the drop-down worked,  but the button failed to restore it.
> > > > Validating the resulting HTML revealed the a div is not permitted in
> > > > the scope of a form.
>
> > > button_to_function creates a form, which would result in a form nested
> > > inside a form, which isn't allowed.
>
> > > 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.

Read More…

[Rails] Re: Displaying a nested field as a label

by rubyonrailsin 0 comments
This is a nested model form using to models: section and comment,
where section has many comments.

"text" is a field for comments
"approval_boolean" is a field for comments

I just want the field value for "text" to show up as a non-form-
element and "approval_boolean" to show as a check box form element.

The code above works, but I can only get the "text" field to show up
as a text_area or text_field form element.

Like I said, if <%= a.text %> worked, I'd be happy... but it gives me
a method error and I'm not sure why.

Ahhhh! a.class = formbuilder. I thought it was a Comments class.
Now I know what to look up.... I guess my question after all is there
any way to "extract" a data value from a field within a formbuilder?
(if I got my terminology right)

Thanks for taking the time to look at this, btw.

-a

On Mar 23, 11:45 am, Michael Pavling <pavl...@gmail.com> wrote:
> On 23 March 2010 16:35, andrew <andrew.ggro...@gmail.com> wrote:
>
> > Ok, I'll clean up the variable names.  Thanks!  :)
>
> > However....
>
> > <%=h comment.txt %>  undefined method `text'
> > <%= text %> and <%=h text %> give undefined local variable or method
> > `text'
>
> > Neither of those ideas work.  :(
>
> Well what *is* your "a/comment" variable? Have you debugged it to see
> what's going on in that block? Do you *know* what methods it's got, or
> are you assuming there's a "text" method?
>
> You can use <% puts .... %> or <% logger.info .... %> to output
> messages to help you diagnose what's going on. Personally, I prefer to
> use breakpoint debugging in Netbeans.
>
> does 'puts a.respond_to("text")' display true?
> what does 'puts a.inspect' give 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Read More…

Re: [Rails] netbeans on ubuntu

by rubyonrailsin 0 comments
On 23 March 2010 16:47, Viorel <viorelvladu@gmail.com> wrote:
> I just installed Netbeans 6.7 on Ubuntu 9.4 and all seems to be OK,
> except I get the following error when I try rake tasks:
>
> Rails requires RubyGems >= 1.3.2 (you have 1.3.1). Please `gem update
> --system` and try again.

That should probably be
sudo gem update --system

Colin

>
> Thank you for any help
> Viorel
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Re: [spree-user] Re: Paypal Express 500 internal server error

by rubyonrailsin 0 comments
Brian,
You don't need to do it for me :-) I just looked through what you
had posted and that's what stood out to me as possibly being
different.

Of course I'm probably going to need the PayPal extension sometime in
the next month so if you guys work out all the bugs in advance that
would be great for me. ;-D

-Chris

On Tue, Mar 23, 2010 at 8:13 PM, Brian Quinn <brian@railsdog.com> wrote:
> Chris,
> I did try the gem version a few days ago for someone else (and it also
> worked), so I figured I try a clone now.
> I'll re-do the gem / spree app approach later today, just to confirm it's
> still working.
> BDQ
>
> On 23 March 2010 09:44, Chris <r3ap3r2004@gmail.com> wrote:
>>
>> Brian,
>> I haven't tried this out, but right off hand I would say the thing you
>> are probably doing different than anyone else is that you cloned spree
>> and didn't actually create a spree app using the gem or vendor spree
>> inside your spree app /vendor/spree.
>>
>> I don't know if that has any effect, but I assume most people are
>> creating a spree app per the docs.
>>
>> Just an observation,
>> -Chris
>>
>> On Tue, Mar 23, 2010 at 6:06 PM, Brian Quinn <brian@railsdog.com> wrote:
>> > I must be doing some weird locally that everyone else is missing, so
>> > here's
>> > the exact steps I just done to get PPE working.
>> > git clone git://github.com/railsdog/spree.git spree-ppe
>> > cd spree-ppe
>> > cp config/database.yml.example config/database.yml
>> > rake db:bootstrap
>> > ./script/plugin install
>> > git://github.com/railsdog/spree-paypal-express.git
>> > rake db:migrate
>> > ./script/server
>> > Once the server starts, login to the admin and create a new Payment
>> > Method
>> > setting the following fields:
>> > Name: PayPal
>> > Environment: Development
>> > Active: Yes
>> > Provider: BillingIntegration::PaypalExpress
>> > Review: unchecked
>> > Server: test
>> > No Shipping: unchecked
>> > Test Mode: checked
>> > For the actual login details, I've been using the PayPal Sandbox (API
>> > Credentials page):
>> > Login:  API Username (be careful NOT to use the test account email
>> > address
>> > here)
>> > Password: API Password
>> > Signature: Signature
>> >
>> > Now try to checkout? Feel free to ping me on the IRC channel if u see me
>> > on
>> > (briandquinn).
>> > Hope this helps.
>> > BDQ
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Spree" group.
>> To post to this group, send email to spree-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> spree-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/spree-user?hl=en.
>>
>
>
>
> --
> Brian Quinn
>
> -------------------------------------------
> Rails Dog LLC
> 2 Wisconsin Circle, Suite 700
> Chevy Chase, MD 20815
> voice: (301)560-2000
> -------------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups
> "Spree" group.
> To post to this group, send email to spree-user@googlegroups.com.
> To unsubscribe from this group, send email to
> spree-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/spree-user?hl=en.
>

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

Read More…

Re: [Rails] netbeans on ubuntu

by rubyonrailsin 0 comments
On 23 March 2010 16:47, Viorel <viorelvladu@gmail.com> wrote:
> I just installed Netbeans 6.7 on Ubuntu 9.4 and all seems to be OK,
> except I get the following error when I try rake tasks:

If you're installing Netbeans, what's wrong with using the latest version (6.8)

> Rails requires RubyGems >= 1.3.2 (you have 1.3.1). Please `gem update
> --system` and try again.

and so the first thing you did was run "gem update --system" and then
what happened...

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

[Rails] netbeans on ubuntu

by rubyonrailsin 0 comments
I just installed Netbeans 6.7 on Ubuntu 9.4 and all seems to be OK,
except I get the following error when I try rake tasks:

Rails requires RubyGems >= 1.3.2 (you have 1.3.1). Please `gem update
--system` and try again.

Thank you for any help
Viorel

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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.

Read More…

Subscribe feeds via e-mail

Blog Archive