[Rails] Re: error in uploading file(help me urgnt)

2010-03-28 Thread Rahul Mehta
hi yong
i got the same proble and solved it ,

you can use in form tag uploadfile instead of uploadFile

and in render file : use #"{root_url}/app/view/--path"

hope you will solve it ..
thanks

rahul

On Mar 28, 10:32 pm, Yong Gu  wrote:
> Did you add uploadFile to route.rb?
>
> And i think you'd better follow rails' convention, instead of writing code
> as like using some other frameworks
>
> On Mon, Mar 29, 2010 at 2:26 PM, Tony Augustine wrote:
>
>
>
> > Yong Gu wrote:
> > > I think use *render :file => 'uploadfile.html.erb'*, as rails would look
> > > for
> > > the template in your view directory, which is "app/views",
>
> > > and if you use render :file => 'controller/uploadfile.html.erb', it will
> > > look for the template in "app/views/controller/uploadfile.html.erb", or
> > > rails always
>
> > > assume you have already put your template in the controller's according
> > > view
> > > folder
>
> > wheen i  did that i am  getting the error like this
>
> > hiii3
> >  SQL (0.5ms)   SET client_min_messages TO 'panic'
> >  SQL (0.5ms)   SET client_min_messages TO 'notice'
> >  SQL (0.6ms)   SET client_encoding TO 'unicode'
>
> > Processing UploadController#uploadFile (for 127.0.0.1 at 2010-03-29
> > 11:47:28) [POST]
> >  Parameters: {"commit"=>"Upload",
> > "authenticity_token"=>"g1vUQZ7QAh7FjfusjbJuh7EBO4UVVFInaYsxzCMK91I=",
> > "date_file"=>{"upload"=>#}}
>
> > NoMethodError (You have a nil object when you didn't expect it!
> > You might have expected an instance of ActiveRecord::Base.
> > The error occurred while evaluating nil.[]):
> > --
> > 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-t...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.- Hide quoted text -
>
> - Show quoted text -

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



Re: [Rails] Re: toggle appear starts hidden ?

2010-03-28 Thread Yong Gu
yes, of course

try <%= button_to_remote "Test", :complete => "toggle_all();" %>

which toggle_all is your own defined javascript funciton or use
$('.clazz').each(function(e) { e.toggle()} ) directly instead of
toggle_all()

in fact, the value of parameter :complete is a javascript function , and
visual_effect generate a function by using prototype.js. So you could

use any javascript function as you wish.



On Mon, Mar 29, 2010 at 2:40 PM, Dudebot  wrote:

> On Mar 28, 11:24 pm, Yong Gu  wrote:
> > i never tried that, but i think you could iterate the elements with the
> > class name like:
> ...
>
> Thanks--I was hoping that I could chain the events within/around the
> visual_effect method--any idea if that's possible in this framework?
>
> Many TIA again,
> Craig
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: toggle appear starts hidden ?

2010-03-28 Thread Dudebot
On Mar 28, 11:24 pm, Yong Gu  wrote:
> i never tried that, but i think you could iterate the elements with the
> class name like:
...

Thanks--I was hoping that I could chain the events within/around the
visual_effect method--any idea if that's possible in this framework?

Many TIA again,
Craig

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



Re: [Rails] Re: error in uploading file(help me urgnt)

2010-03-28 Thread Yong Gu
Did you add uploadFile to route.rb?

And i think you'd better follow rails' convention, instead of writing code
as like using some other frameworks

On Mon, Mar 29, 2010 at 2:26 PM, Tony Augustine wrote:

> Yong Gu wrote:
> > I think use *render :file => 'uploadfile.html.erb'*, as rails would look
> > for
> > the template in your view directory, which is "app/views",
> >
> > and if you use render :file => 'controller/uploadfile.html.erb', it will
> > look for the template in "app/views/controller/uploadfile.html.erb", or
> > rails always
> >
> > assume you have already put your template in the controller's according
> > view
> > folder
>
> wheen i  did that i am  getting the error like this
>
> hiii3
>  SQL (0.5ms)   SET client_min_messages TO 'panic'
>  SQL (0.5ms)   SET client_min_messages TO 'notice'
>  SQL (0.6ms)   SET client_encoding TO 'unicode'
>
>
> Processing UploadController#uploadFile (for 127.0.0.1 at 2010-03-29
> 11:47:28) [POST]
>  Parameters: {"commit"=>"Upload",
> "authenticity_token"=>"g1vUQZ7QAh7FjfusjbJuh7EBO4UVVFInaYsxzCMK91I=",
> "date_file"=>{"upload"=>#}}
>
> NoMethodError (You have a nil object when you didn't expect it!
> You might have expected an instance of ActiveRecord::Base.
> The error occurred while evaluating nil.[]):
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: error in uploading file(help me urgnt)

2010-03-28 Thread Tony Augustine
Yong Gu wrote:
> I think use *render :file => 'uploadfile.html.erb'*, as rails would look 
> for
> the template in your view directory, which is "app/views",
> 
> and if you use render :file => 'controller/uploadfile.html.erb', it will
> look for the template in "app/views/controller/uploadfile.html.erb", or
> rails always
> 
> assume you have already put your template in the controller's according 
> view
> folder

wheen i  did that i am  getting the error like this

hiii3
  SQL (0.5ms)   SET client_min_messages TO 'panic'
  SQL (0.5ms)   SET client_min_messages TO 'notice'
  SQL (0.6ms)   SET client_encoding TO 'unicode'


Processing UploadController#uploadFile (for 127.0.0.1 at 2010-03-29 
11:47:28) [POST]
  Parameters: {"commit"=>"Upload", 
"authenticity_token"=>"g1vUQZ7QAh7FjfusjbJuh7EBO4UVVFInaYsxzCMK91I=", 
"date_file"=>{"upload"=>#}}

NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]):
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: toggle appear starts hidden ?

2010-03-28 Thread Yong Gu
i never tried that, but i think you could iterate the elements with the
class name like:

$$('.clazz').each(function(e) {
  e.toggle();
})

or else, you could write your own function, for example:
function toggle_all() {
  toggle1();
  toggle2();
  ..
}

function toggle1() {
  ...
}

function toggle2() {
  ...
}


On Mon, Mar 29, 2010 at 2:15 PM, Dudebot  wrote:

> On Mar 28, 11:10 pm, Yong Gu  wrote:
> > try  yada yada yada 
>
> Thanks, Yong!
>
> One other question: is it possible to have multiple divs toggling on/
> off at the same time?  I tried changing "id" to "class", and then it
> simply wouldn't toggle.
>
> Many TIA again,
> Craig
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] error in uploading file(help me urgnt)

2010-03-28 Thread Yong Gu
I think use *render :file => 'uploadfile.html.erb'*, as rails would look for
the template in your view directory, which is "app/views",

and if you use render :file => 'controller/uploadfile.html.erb', it will
look for the template in "app/views/controller/uploadfile.html.erb", or
rails always

assume you have already put your template in the controller's according view
folder

On Mon, Mar 29, 2010 at 12:41 PM, Tony Augustine wrote:

> when i tried  to crate an upload file application in rails i am  getting
> error like this
>
>
> Template is missing
>
> Missing template app\views\upload\uploadfile.html.erb in view path
> app/views
>
> this is  ma  model
>
>
> class DataFile < ActiveRecord::Base
>  def self.save(upload)
>name =  upload['datafile'].original_filename
>directory = "public/data"
># create the file path
>path = File.join(directory, name)
># write the file
>File.open(path, "wb") { |f| f.write(upload['datafile'].read) }
>  end
> end
>
>
>
>
> this is ma view  file
>
>
> File Upload
> <%= start_form_tag ({:action => 'uploadFile'},
>:multipart => true) %>
> Select File :
> <%= file_field 'upload', 'datafile' %>
> <%= submit_tag "Upload" %>
> <%= end_form_tag %>
>
>
>
>
> This is ma controller
>
> class UploadController < ApplicationController
>  def index
> puts 'hiii'
> render :file => 'app\views\upload\uploadfile.html.erb'
> puts 'hiii2'
>  end
>  def uploadFile
> puts 'hiii3'
>post = DataFile.save(params[:upload])
>render :text => "File has been uploaded successfully"
>  end
> end
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: toggle appear starts hidden ?

2010-03-28 Thread Dudebot
On Mar 28, 11:10 pm, Yong Gu  wrote:
> try  yada yada yada 

Thanks, Yong!

One other question: is it possible to have multiple divs toggling on/
off at the same time?  I tried changing "id" to "class", and then it
simply wouldn't toggle.

Many TIA again,
Craig

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



[Rails] toggle appear starts hidden ?

2010-03-28 Thread Dudebot
This definitely works:

<%= button_to_remote "Test", :complete =>
visual_effect( :toggle_appear, "toggle_appear" ) %>
 yada yada yada 

To toggle content off -> content on, etc.

But is there any way to have the initial content hidden?

Many TIA,
Craig

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



Re: [Rails] toggle appear starts hidden ?

2010-03-28 Thread Yong Gu
try  yada yada yada 

On Mon, Mar 29, 2010 at 2:05 PM, Dudebot  wrote:

> This definitely works:
>
> <%= button_to_remote "Test", :complete =>
> visual_effect( :toggle_appear, "toggle_appear" ) %>
>  yada yada yada 
>
> To toggle content off -> content on, etc.
>
> But is there any way to have the initial content hidden?
>
> Many TIA,
> Craig
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] seed data

2010-03-28 Thread Conrad Taylor
On Fri, Mar 26, 2010 at 3:19 AM, Tom Mac  wrote:

> Hi
>   I am using seed_fu to seed initial data to tables
> (http://github.com/mbleigh/seed-fu) . And in db/fixtures/state.rb
>
> I have values like (I am filling only two data for simplicity)
>
> State.seed_many(:name, :abbr,:fips,:country_id, [
>  { :name => "Alberta", :abbr => 'AB',:fips => '01', :country_id =>
> 2 },
>  { :name => "Alaska", :abbr => 'AK',:fips => '02', :country_id => 1
> }
> ])
>
> It works and when I do  select * from states; I get result as
>
> +-+--+---+--++
> | id  | abbr | name  | fips | country_id |
> +-+--+---+--++
> | 1 | AB   | Alberta   | 01   |  2 |
> | 2 | AK   | Alaska| 02   |  1 |
>
>But now I modified state.rb as
>
> State.seed_many(:name, :abbr,:fips,:country_id, [
>  { :name => "Alberta", :abbr => 'AB',:fips => '01', :country_id =>
> 2 },
>  { :name => "Alaska", :abbr => 'AK',:fips => '02', :country_id => 1
> }
> ])
> State.destroy_all
> State.create(:id => 1,:name => "Alabama", :abbr => 'AL',:fips => '01',
> :country_id => 1)
>
>
Tom, you shouldn't be setting the value of the :id field because the
database
will ignore your setting and assign the next unique identifier
automatically.
Could you explain what you're trying to do in a step by step scenario?  This
may helper others on the mailing list to better assist you.

-Conrad


>
> And now when I do select * from states; I get unexpected result as
>
> +-+--+---+--++
> | id  | abbr | name  | fips | country_id |
> +-+--+---+--++
> | 5 | AL   | Alabama   | 01   |  1 |
>
>
>   What I expect was  id=1 But I got id as 5 . Why this ?
>
>
> Thanks in advance
> Tom
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Act_as_Solr Query time

2010-03-28 Thread mahesh s
Hi friends

Im using act as solr for my project i would like to display query time for
my results, im getting the query time from solr whether the Qtime is
microsecond or millisecond can any one help me for this

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



[Rails] Re: executing jar files from within rails app

2010-03-28 Thread senling
You can use system call to execute jar file.

# Change to the directory where jar resides
Dir.chdir("#{RAILS_ROOT}/public//") do

# Execute jar
retResult  = system(" -jar ..  ")

if retResult
  Jar executes succesfully
else
  error in executing jar file.

end #chdir

Thanks
Senling

On Mar 29, 12:10 am, Gautam  wrote:
> I have a rails app and a jar file.
> I want my jar file to execute when the user presses a button on the
> webpage.
> Please tell me how to do that.
>
> Any help will be highly appreciated.
> Thanks in anticipation. :)

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



[Rails] Re: seed data

2010-03-28 Thread Tom Mac
Hi
   So my question is how can I ensure that even after running  rake 
db:seed  (rake db:seed_fu) a number of times my primary key ie, id here, 
does not get modified? Should I need to write an update_id function 
again?

Thanks
Tom
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] error in uploading file(help me urgnt)

2010-03-28 Thread Tony Augustine
when i tried  to crate an upload file application in rails i am  getting
error like this


Template is missing

Missing template app\views\upload\uploadfile.html.erb in view path
app/views

this is  ma  model


class DataFile < ActiveRecord::Base
  def self.save(upload)
name =  upload['datafile'].original_filename
directory = "public/data"
# create the file path
path = File.join(directory, name)
# write the file
File.open(path, "wb") { |f| f.write(upload['datafile'].read) }
  end
end




this is ma view  file


File Upload
<%= start_form_tag ({:action => 'uploadFile'},
:multipart => true) %>
Select File :
<%= file_field 'upload', 'datafile' %>
<%= submit_tag "Upload" %>
<%= end_form_tag %>




This is ma controller

class UploadController < ApplicationController
  def index
puts 'hiii'
 render :file => 'app\views\upload\uploadfile.html.erb'
puts 'hiii2'
  end
  def uploadFile
puts 'hiii3'
post = DataFile.save(params[:upload])
render :text => "File has been uploaded successfully"
  end
end
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Error with Textmate Cucumber Bundle Run Command

2010-03-28 Thread Ruby.Tuesday
I'm encountering an error within Textmate when executing the Run
command, Command-R, from within a .feature file.  The error message is
"env: sh: No such file or directory".  I've installed the Cucumber
bundle from github and updated all gems.

My path correctly points to ruby interpreter location.  Any ideas?

Thank you in advance.

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



[Rails] Re: Re: Re: Re: Re: Prototype Helpers & jQuery

2010-03-28 Thread Chris Kalaboukis
> ah ha...I'm getting this error:
> 
> jQuery is not defined
> [Break on this error] jQuery.extend(String.prototype, {
> 
> in application.js line 29
> 
> jQuery.extend(String.prototype, {
> 30 databaseId: function() { return $.trim(this.split('_').last()); }
> 31});

Any ideas?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Adding data to database directly through Ruby code

2010-03-28 Thread Frederick Cheung


On Mar 28, 7:23 pm, Derek Cannon  wrote:
>
> But now that I'm getting started with Rails, I'd like to create a
> controller that -- instead of displaying the movie information to the
> console -- would write these variables into a SQLite3 database. I've
> looked around, and I've already got the database set up, and with
> Scaffolding, I can add/edit/remove entries manually, but I'm still
> unsure of how to:
>
> 1. Copy/paste my Ruby code into my Rails project. (Does the class I've
> created simply go into a new controller, or is there some other
> convention for where to put complete Ruby classes?)
> 2. How to add the variables directly to the database, so I don't have to
> manually enter the data.

What you would typically do is create a subclass of ActiveRecord::Base
called Movie. Whenever you create and save and object of that class a
row appears in the movies table. Instead of creating instances of your
current Movie class, create instances of your new ActiveRecord derived
one. Your xml parsing code can probably stay pretty much the same,
except that you'll either want to do Movie.create(hash_of_attributes)
or do Movie.new and then set the attributes one by one.

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



[Rails] Re: Adding data to database directly through Ruby code

2010-03-28 Thread Gautam
1. You have to create controllers with the class names and then you
can copy the code in the controllers.
2. You can create a model and a database with all the fields you want
and then you can insert the data in the db from the variables using a
controller.

I am also a beginner at Rails. So, please confirm this with someone
else as well.
Happy coding!

On Mar 28, 11:23 pm, Derek Cannon  wrote:
> (First, I'm very new to Rails and still slightly new to Ruby. So bare
> with me.)
>
> I made a Ruby application that allows me to view local XML files which
> contain information on my favorite movies. My program reads the XML
> files and loads them into variables (such as @title = "The Terminator,
> @year = "1984", etc). All of this is done in a class called Movie, so I
> get all the XML files from a directory, then create an array of Movie
> classes which all hold the information for their specific XML file.
>
> (For the visual thinkers, that's: my_dir.each { |i|
> my_array.push(Movie.new(i)) })
>
> Everything works fine, and I can organize the data however I please.
>
> But now that I'm getting started with Rails, I'd like to create a
> controller that -- instead of displaying the movie information to the
> console -- would write these variables into a SQLite3 database. I've
> looked around, and I've already got the database set up, and with
> Scaffolding, I can add/edit/remove entries manually, but I'm still
> unsure of how to:
>
> 1. Copy/paste my Ruby code into my Rails project. (Does the class I've
> created simply go into a new controller, or is there some other
> convention for where to put complete Ruby classes?)
> 2. How to add the variables directly to the database, so I don't have to
> manually enter the data.
>
> If anyone could help me with this, I'd greatly appreciate it. If you're
> curious as to my level of knowledge in Rails, the only things I have a
> fairly good grasp on are: how to start a server, how to view the pages
> on the server, how to create a database (with all the tables I need),
> how to create a scaffolding, and what the difference is between
> controllers and the actual view page.
> --
> 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] executing jar files from within rails app

2010-03-28 Thread Gautam
I have a rails app and a jar file.
I want my jar file to execute when the user presses a button on the
webpage.
Please tell me how to do that.

Any help will be highly appreciated.
Thanks in anticipation. :)

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



[Rails] ActionController::UnknownHttpMethod: ***, accepted HTTP methods are get, head, put, post, delete, and options

2010-03-28 Thread jemminger
I'm occasionally getting exception notices with this error message:

  ActionController::UnknownHttpMethod: ***, accepted HTTP methods are
get, head, put, post, delete, and options

Anyone ever seen this or know what could be causing it?

Thanks,
Jeff

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



[Rails] Re: ActiveRecord::StatementInvalid: Mysql Errorr public_indices

2010-03-28 Thread Graham Farrell
Frederick Cheung wrote:
> On 28 Mar, 16:17, Graham Farrell  wrote:
>> `publiic_indices`
>>
>> I know that none of my tables have an index setup could this be the
>> problem??
>>
> It's looking for a table called publiic_indices, which sounds like a
> typo to me - public_indices would be a more normal spelling. If your
> database does contain a public_indices table then see if there are any
> references to that table name or a publiic_indices.yml fixture file
> and try correcting the spelling.
> 
> Fred

Hi Fred,

I noticed that it was looking for the table but I knew that I didn't 
have a table of this name in my project.
I found the offending yml file in the fixtures, it was from a MVC that 
one of the other guys had created then deleted but for some reason the 
this file wasn't deleted also.

Thanks for your help,

Graham
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: accepts_nested_attributes_for - issue

2010-03-28 Thread slindsey3000
Yes, you are correct.  Terrible naming.  But was done to try quick
example.  I am creating new player so
@cpr it won't find player because I am in fact creating one.  I
know... terrible code.

It seems to be looking for Active Record object and I am passing in
array...

Help!


On Mar 28, 6:08 am, Art Shayderovtry   wrote:
> It's rather unusual to name the action 'index' when it shows form for
> creating a new object. Why not call it 'new' or something like that.
> And then the action is named 'update_player' when in fact it is
> creating a new Player object. Why don't you name it 'create'?
> I'm sorry for nitpicking but choosing the right names will make your
> life easier. (and will raise your chances for getting the answer)
>
> Regarding your question. I usually look at params in such a situation.
> You can find request params in webserver log(just scroll console
> window where webrick is started) or you can insert a call to
> 'debugger' in the action and start webserver in debug mode (with '--
> debugger').

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



[Rails] Adding data to database directly through Ruby code

2010-03-28 Thread Derek Cannon
(First, I'm very new to Rails and still slightly new to Ruby. So bare
with me.)

I made a Ruby application that allows me to view local XML files which
contain information on my favorite movies. My program reads the XML
files and loads them into variables (such as @title = "The Terminator,
@year = "1984", etc). All of this is done in a class called Movie, so I
get all the XML files from a directory, then create an array of Movie
classes which all hold the information for their specific XML file.

(For the visual thinkers, that's: my_dir.each { |i|
my_array.push(Movie.new(i)) })

Everything works fine, and I can organize the data however I please.

But now that I'm getting started with Rails, I'd like to create a
controller that -- instead of displaying the movie information to the
console -- would write these variables into a SQLite3 database. I've
looked around, and I've already got the database set up, and with
Scaffolding, I can add/edit/remove entries manually, but I'm still
unsure of how to:

1. Copy/paste my Ruby code into my Rails project. (Does the class I've
created simply go into a new controller, or is there some other
convention for where to put complete Ruby classes?)
2. How to add the variables directly to the database, so I don't have to
manually enter the data.

If anyone could help me with this, I'd greatly appreciate it. If you're
curious as to my level of knowledge in Rails, the only things I have a
fairly good grasp on are: how to start a server, how to view the pages
on the server, how to create a database (with all the tables I need),
how to create a scaffolding, and what the difference is between
controllers and the actual view page.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] ActionMailer Attachment : Character encoding for :filename

2010-03-28 Thread Adrien Coquio
Hi,

I want to send a file "joke.txt" with ActionMailer but I want to
rename the file in the mail "député.txt"
I set the parameters :filename of the attachment to "député.txt"

But when I receive the mail I can see : "d��put��.txt"

In the log :
filename*=iso-2022-jp'ja'd%c3%a9put%c3%a9.txt

How can I fix it ?

Thanks for your answer :)

adrien

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



[Rails] Re: accepts_nested_attributes_for - issue

2010-03-28 Thread Art Shayderov
It's rather unusual to name the action 'index' when it shows form for
creating a new object. Why not call it 'new' or something like that.
And then the action is named 'update_player' when in fact it is
creating a new Player object. Why don't you name it 'create'?
I'm sorry for nitpicking but choosing the right names will make your
life easier. (and will raise your chances for getting the answer)

Regarding your question. I usually look at params in such a situation.
You can find request params in webserver log(just scroll console
window where webrick is started) or you can insert a call to
'debugger' in the action and start webserver in debug mode (with '--
debugger').

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



[Rails] Re: Array data type----What can Be Done

2010-03-28 Thread Art Shayderov
Why is the name of your variable starting with '$'?

Names starting with '$' are reserved for environment variables. I'm
not sure about '$x' but you better follow ruby and rails guidelines
for naming variables or you may be asking for trouble.

On Mar 28, 4:10 pm, Felix Schäfer  wrote:
> Am 28.03.2010 um 10:38 schrieb kevid:
>
> > please i have an array in my rails application (for example; $x = [23,
> > how, this,56, you, nice])
>
> > I want to store it in a mysql database as a SINGLE RECORD  with a
> > name .
>
> > thus  i can get each array with its name and still be able to access
> > the array like an array
>
> > i.e $x[0]   # => 23
> >    $x[1]   # => how
>

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



[Rails] Re: ActiveRecord::StatementInvalid: Mysql Errorr public_indices

2010-03-28 Thread Frederick Cheung


On 28 Mar, 16:17, Graham Farrell  wrote:
> Hi all,
>
> I'm new to ROR so sorry if this is simple.
>
> I'm using NetBeans 6.8 as my IDE and I'm trying to run tests on my
> shared project but I'm hitting the error beow and I can't figure out
> what it means.
>
> ActiveRecord::StatementInvalid: Mysql::Error: Table
> 'mydatabase_test.publiic_indices' doesn't exist: DELETE FROM
> `publiic_indices`
>
> I know that none of my tables have an index setup could this be the
> problem??
>
It's looking for a table called publiic_indices, which sounds like a
typo to me - public_indices would be a more normal spelling. If your
database does contain a public_indices table then see if there are any
references to that table name or a publiic_indices.yml fixture file
and try correcting the spelling.

Fred

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



[Rails] Re: How can i install ruby on rails in ubuntu

2010-03-28 Thread Art Shayderov
Current version in Ubuntu repository is 2.2.3 which lags pretty much
behind official Rails repository (current stable release 2.3.5)

Regarding the original question, anyway you need some kind of Rails
tutorial and every one of them contains installation instructions.
Rails isn't particularly difficult to install.

and I would strongly recommend RVM http://rvm.beginrescueend.com/.
Makes managing rubies and gems much easier.

On Mar 28, 5:17 pm, Colin Law  wrote:
> On 28 March 2010 11:23, Castilho  wrote:
>
> > If your Ubuntu is the 9.10, then
> > apt-get install rails

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



[Rails] Re: keeping track of who did what

2010-03-28 Thread E. Litwin
Why not use one of the versioning/auditing gems (http://ruby-
toolbox.com/categories/activerecord_versioning.html) instead?


On Mar 28, 5:30 am, eugenio  wrote:
> hello everybody.
> i need to log "who did what" on some models. i was reading recipe 59
> of rails recipes and i created something like that:
>
> class LogSweeper < ActionController::Caching::Sweeper
>   observe :model1, :model2, :model3, :model4, :model5, ...
>
>   after_save(model)
>     save_log(model, "save")
>   end
>
>   after_destroy(model)
>      save_log(model, "destroy)
>   end
>
>   private
>   save_log(model, event, user_id = controller.session[:account_id])
>     #create the log entry, i want to save the id of the model, the id
> of the logged user and something to describe the action.
>     #controller isn't defined here so i can't access the user_id.
>   end
> end
>
> in environment.rb i added:
>   config.active_record.observers = :log_sweeper
>
> the sweeper is called when something happen to the observed models,
> but i can't access the controller (and so, the user_id) from there.
> any 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: accepts_nested_attributes_for - issue

2010-03-28 Thread cpr
I haven't tried running your code, but please change:

 def update_player
 @player = Player.new(params[:player])
 @player.save
 redirect_to :action => :index
 end

to

 def update_player
 @player = Player.find_by_id(params[:id])
 @player.update_attributes(params[:player])
 redirect_to :action => :index
 end

and give it a shot.

On Mar 27, 10:16 pm, slindsey3000  wrote:
> Just trying a simple example to try to get nested to work... but can't
> get it!  Been 2 days!  Please help.   VERY SIMPLE controller, view,
> models... listed below.
>
> --ERROR
> MESSAGE --
>
> ActiveRecord::AssociationTypeMismatch in UserController#update_player
>
> Racquet(#38866740) expected, got Array(#20762670)
>
> --- 
> --
>
> -MODELS-
>
> class Player < ActiveRecord::Base
>
>     has_many :racquets, :dependent => :destroy
>
>     accepts_nested_attributes_for :racquets
>
> end
>
> class Racquet < ActiveRecord::Base
>
>      belongs_to :player
>
> end
>
> --CONTROLLER-
>
> class UserController < ApplicationController
>
>    def index
>     �...@player = Player.new
>     �...@player.racquets.build
>    end
>
>    def update_player
>     �...@player = Player.new(params[:player])
>     �...@player.save
>      redirect_to :action => :index
>    end
>
> end
>
> --- VIEW
> ---
>
> 
> <% form_for :player, :url => { :action => :update_player, :id =>
> @player.id } do |f| %>
>
>   Name: <%= f.text_field :name %> 
>   Rank: <%= f.text_field :rank %> 
>
>   <% f.fields_for :racquets do |racquets_form| %>
>
>   Racquet Name: <%= racquets_form.text_field :typ %> 
>   <% end %>
>
>   <%= f.submit "Submit" %>
>   <% end %>
> 
>
> --- 
> -
>
> This was supposed to be quick practice form to make use of nested
> models and has turned into a nightmare.  Can anyone tell my why it
> is not working???
>
> Thanks so much,
>
> Shawn

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



[Rails] ActiveRecord::StatementInvalid: Mysql Errorr public_indices

2010-03-28 Thread Graham Farrell
Hi all,

I'm new to ROR so sorry if this is simple.

I'm using NetBeans 6.8 as my IDE and I'm trying to run tests on my
shared project but I'm hitting the error beow and I can't figure out
what it means.


ActiveRecord::StatementInvalid: Mysql::Error: Table
'mydatabase_test.publiic_indices' doesn't exist: DELETE FROM
`publiic_indices`


I know that none of my tables have an index setup could this be the
problem??


Any help greatly appricated.

Graham
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: How can i install ruby on rails in ubuntu

2010-03-28 Thread Colin Law
On 28 March 2010 11:23, Castilho  wrote:
> If your Ubuntu is the 9.10, then
> apt-get install rails

That should be sudo apt-get install rails of course, but I thought
there were some issues installing from the ubuntu repository though I
don't remember what.

Colin

> otherwise
> http://castilho.biz/blog/2009/11/05/ruby-on-rails-ubuntu-9-10-karmic-koala
>
> Best regards
>
> On Mar 27, 6:41 pm, sachiguns  wrote:
>> i am new to rails so please help me to install
>> ruby on rails to my ubuntu 9.10
>>
>> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] keeping track of who did what

2010-03-28 Thread eugenio
hello everybody.
i need to log "who did what" on some models. i was reading recipe 59
of rails recipes and i created something like that:

class LogSweeper < ActionController::Caching::Sweeper
  observe :model1, :model2, :model3, :model4, :model5, ...

  after_save(model)
save_log(model, "save")
  end

  after_destroy(model)
 save_log(model, "destroy)
  end

  private
  save_log(model, event, user_id = controller.session[:account_id])
#create the log entry, i want to save the id of the model, the id
of the logged user and something to describe the action.
#controller isn't defined here so i can't access the user_id.
  end
end

in environment.rb i added:
  config.active_record.observers = :log_sweeper


the sweeper is called when something happen to the observed models,
but i can't access the controller (and so, the user_id) from there.
any 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Array data type----What can Be Done

2010-03-28 Thread Felix Schäfer

Am 28.03.2010 um 10:38 schrieb kevid:

> please i have an array in my rails application (for example; $x = [23,
> how, this,56, you, nice])
> 
> I want to store it in a mysql database as a SINGLE RECORD  with a
> name .
> 
> thus  i can get each array with its name and still be able to access
> the array like an array
> 
> i.e $x[0]   # => 23
>$x[1]   # => how
> 
> .and so on
> 
> I don't know what DATA TYPE to use and how to do it.


See "Saving arrays, hashes, and other non-mappable objects in text columns" in 
http://api.rubyonrails.org/classes/ActiveRecord/Base.html

Felix

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



[Rails] Re: Array data type----What can Be Done

2010-03-28 Thread Rahul Mehta
you can take varchar dear i hope it will work..

On Mar 28, 1:38 pm, kevid  wrote:
> Hi all,
>
> please i have an array in my rails application (for example; $x = [23,
> how, this,56, you, nice])
>
>  I want to store it in a mysql database as a SINGLE RECORD  with a
> name .
>
> thus  i can get each array with its name and still be able to access
> the array like an array
>
> i.e $x[0]   # => 23
>     $x[1]   # => how
>
> .and so on
>
>  I don't know what DATA TYPE to use and how to do it.
>
> any sugesstion is welcomed.

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



[Rails] Re: How can i install ruby on rails in ubuntu

2010-03-28 Thread Castilho
If your Ubuntu is the 9.10, then
apt-get install rails

otherwise
http://castilho.biz/blog/2009/11/05/ruby-on-rails-ubuntu-9-10-karmic-koala

Best regards

On Mar 27, 6:41 pm, sachiguns  wrote:
> i am new to rails so please help me to install
> ruby on rails to my ubuntu 9.10
>
> 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Array data type----What can Be Done

2010-03-28 Thread kevid
Hi all,

please i have an array in my rails application (for example; $x = [23,
how, this,56, you, nice])

 I want to store it in a mysql database as a SINGLE RECORD  with a
name .

thus  i can get each array with its name and still be able to access
the array like an array

i.e $x[0]   # => 23
$x[1]   # => how

.and so on

 I don't know what DATA TYPE to use and how to do it.

any sugesstion is welcomed.

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



[Rails] eCommerce admin systems.

2010-03-28 Thread JezCrooks
Hi - I'm looking for a catalogue/order management/CRM back
office...anyone got any recommendations?

Thanks,

Cheers,

J.

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



Re: [Rails] How can i install ruby on rails in ubuntu

2010-03-28 Thread Christophe Decaux
I'm sorry I only have a French link to give you. But it's a pretty  
good one which saved my life last week. I'm sure you can translate it  
with google.


http://www.mickael-allain.fr/index.php?post/2009/05/16/Installation-d-un-environnement-de-développement-Ruby-On-Rails-sous-Ubuntu-8.10-/-9.0 
4


At least you can follow the line of codes.

Good luck.
Christophe


Le 27 mars 2010 à 23:41, sachiguns  a écrit :


i am new to rails so please help me to install
ruby on rails to my ubuntu 9.10


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




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



[Rails] Re: [ANN] Ruby Summer of Code 2010

2010-03-28 Thread Jeremy Kemper
On Sun, Mar 28, 2010 at 1:41 AM, Robert Gleeson  wrote:
> I'd ask the same as Samuel. Is this just for people in the united
> states?

Ruby Summer of Code is open to all students worldwide, minus those in
the handful of countries prohibited by U.S. law (e.g. Cuba, Iran,
Syria, ...)

Last year, Rails had only 1 U.S. citizen among our 4 students
participating in Google Summer of Code.

jeremy

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



Re: [Rails] displaying model data in a form

2010-03-28 Thread Colin Law
On 28 March 2010 07:38, Constantin  wrote:
> I have an edit form with multiple input fields, however I would like
> some of the object data to be displayed just as reference data, not in
> an actual input field. How do I include simple object data in a form,
> without including it in an input field?

<%= @some_object.fieldname %>
Unless I misunderstand the question.

This is such a basic question that I suspect you would benefit from
reading the guides at http://guides.rubyonrails.org/.

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



Re: [Rails] Re: How can i install ruby on rails in ubuntu

2010-03-28 Thread Colin Law
On 27 March 2010 23:10, Luan  wrote:
>
> You can read the instructions here:
>
> http://rubyonrails.org/download
>
> 1. First, you need to install rubygems here
>    http://docs.rubygems.org/
>
>    Install rubygems instruction here:
>    http://docs.rubygems.org/read/chapter/3
>
> 2. Then you can install rails. The instruction also here:
>    http://rubyonrails.org/download

Those are not particularly helpful as they are not ubuntu specific.
For example http://docs.rubygems.org/read/chapter/3 suggests gem
install rails when on Ubuntu it should be sudo gem install rails.

Google for ubuntu install ruby rails will I am sure give lots of hits.
 I use this script to install it for use with apache and mysql.  You
would have to tweak the folder names.  Also check whether I am
fetching the latest version of rubygems, it may have been upgraded
since I used this last.  Note that there are other solutions which
avoid apache and mysql but this is how I do it.  Install apache and
mysql first, preferably (see below).

# this derived from
http://www.hackido.com/2009/04/install-ruby-rails-on-ubuntu-904-jaunty.html
# bits for building stuff
sudo apt-get install build-essential
# ruby and mysql stuff, this assumes that the lamp stack with mysql
has already been installed
sudo apt-get install ruby ri rdoc libmysql-ruby ruby1.8-dev irb1.8
libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient15off
libnet-daemon-perl libplrpc-perl libreadline-ruby1.8 libruby1.8
rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8
libhtml-template-perl
wget -N  -P /home/colinl/downloads
http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xvzf /home/colinl/downloads/rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb
cd ..
rm -rf rubygems-1.3.5
echo " making symlinks - not sure if this will always be necessary,
must be done if gem -v does not work"
sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb
# rails latest version
sudo gem install rails
# any other versions needed
#sudo gem install rails --version 2.3.2

To install the lamp stack and mysql - preferably do this before
install ruby and rails
# this installs the lamp stack, the ^ is important. See
https://help.ubuntu.com/community/Tasksel
sudo apt-get install lamp-server^
sudo apt-get install libapache2-mod-auth-mysql phpmyadmin
echo "**"
echo "check server by http://localhost, should show 'It Works'"
echo "to check php (or just go to phpmyadmin below):"
echo "gksudo gedit /var/www/testing.php and put  in it"
echo "restart apache, not sure why by sudo service apache2 restart
(possibly because php was installed after apache)"
echo "go to http://localhost/testing.php";
echo "check phpmyadmin by http://localhost/phpmyadmin";
echo "To allow access to ~/webpages edit /etc/apache2/sites-available/default"
echo "Change Document Root and associated directory line from /var/www
to /home/colinl/websites"
echo "note that doc root has no trailing /, directory does.  Then
restart apache"
echo "**"

Colin

> On Mar 27, 4:41 pm, sachiguns  wrote:
>> i am new to rails so please help me to install
>> ruby on rails to my ubuntu 9.10
>>
>> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] [ANN] Mail 2.1.5 Pushed

2010-03-28 Thread Mikel Lindsaar
Hi all,

Mail 2.1.5 has now been pushed to Gemcutter.

Key features and bug fixes

* Mail now tries to be smart about the body and auto encodes where it
can, makes things work nicer - big thank you to Peter Bowen
(github.com/pzb) for this work.
* Mail::Message now provides a #errors method.  This contains an array
for each header field that failed to parse, the header field will then
be parsed as an UnstructuredField.
* Updated vendor'd treetop with latest changes from Nathan Sobo's
branch and Jeremy Kemper's branch
* Keep header field case when instantiating an Unstructured Field.
* Adding Message#decoded returns Message#body#decoded if the message
is not multipart
* Content transfer encoding failed on trailing semi-colon, fixed

You can get it from gemcutter or from github/mikel/mail tag 2.1.5

-- 
http://rubyx.com/
http://lindsaar.net/

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