[Rails] Re: Image Crop

2009-03-06 Thread Nike Mike
Alex Wayne wrote: > Dustin wrote: >> I want to make a program that will be able to take an image file and >> crop a square at a given coordinate value (X,Y). >> >> I would tell it the X,Y and the size of the crop ie. 350x350. The X,Y >> would be the center of the newly created image. >> >> Tha

[Rails] Re: 2.2.2 issue - find :joins combining named assoc and SQL string

2009-03-06 Thread Kevin Gilpin
I have the same problem. A query which was previously: macro_step = Step.find :first, :include => [ :parameters ], :conditions => [ "name = 'delegate_id' AND int_v = ?", macro.id ] failed with the message ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'name' in 'where cla

[Rails] Re: How: From database to "schema.rb" file ?

2009-03-06 Thread Tom Ha
Thanks a lot ! -- 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 unsubsc

[Rails] Re: How: From database to "schema.rb" file ?

2009-03-06 Thread Maurício Linhares
rake db:schema:dump - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Fri, Mar 6, 2009 at 10:15 AM, Tom Ha wrote: > > Hi there! > > > Is there a way to get a complete/up-to-date "schema.rb" file, based on > just the database? (without using any

[Rails] How: From database to "schema.rb" file ?

2009-03-06 Thread Tom Ha
Hi there! Is there a way to get a complete/up-to-date "schema.rb" file, based on just the database? (without using any migration files...) === Background: 1. I had stopped using migrations at some point in time and then have modified my db "manually", using phpMyAdmin.

[Rails] Re: Association broken when upgrading from rails 1.2.6 to 2.2.2

2009-03-06 Thread gundestrup
jep, you are 100% correct. On Mar 6, 1:47 pm, MaD wrote: > in that view, does >   <%= course.class %> >   <%= course.semester_id %> > give you something like this >   Course >   32 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

[Rails] Re: Rails 2.2 - Getting started - need some help

2009-03-06 Thread Johan Van mol
Sorry, I thought this forum could understand Textile... Here we go again: Hi, I've used ROR in the past, but recently started working with version 2.2. I don't seem to be able to get started: 1/ I create a rails app: rails music_library 2/ I create a db using an SQlite gui: music_library_DB.r

[Rails] Re: comprehension question about controllers

2009-03-06 Thread Heinz Strunk
Didn't tell me much I didn't know already but what it didn't tell is how am I supposed to keep my application RESTful if I need to load various resources in one single action? I mean it's easy to stay RESTful in small applications like a blog with a small amount of resource and maybe 2 or 3 ne

[Rails] Re: Association broken when upgrading from rails 1.2.6 to 2.2.2

2009-03-06 Thread MaD
in that view, does <%= course.class %> <%= course.semester_id %> give you something like this Course 32 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send

[Rails] Rails 2.2 - Getting started - need some help

2009-03-06 Thread Johan Van mol
Hi, I've used ROR in the past, but recently started working with version 2.2. I don't seem to be able to get started: # I create a rails app: @rails music_library@ # I create a db using an SQlite gui: @music_library_DB.rsd@ # I edit the config/database.yml file: @development: adapter: sqlite3

[Rails] Google meshups

2009-03-06 Thread krishna
Hello guys, How to change the google Maptype to hybrid instead of satelite/map --~--~-~--~~~---~--~~ You received 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@goo

[Rails] Multiplicate values of 2 textfields in a multi model form

2009-03-06 Thread M. Schaefer
Hi all, I tried to multiplicate two form fields in a tablerow just to inform the user and without bothering the server. I'm sure this seems to be a simple javascript problem, but all I got running was the following example: <% fields_for "offer[offer_item_attributes][]", itemtablerow do |f| %>

[Rails] Re: How to pass current value of form field in link_to?

2009-03-06 Thread Jeba Momin
Joe Peck wrote: > Muchas gracias, that is close to perfect. The only problem is if I hit > "Preview Post" multiple times, it keeps adding onto body, but I can fix > that problem. > > It's times like these that I realize I need to learn more javascript. Hi Joe Can u please share wid me how did

[Rails] Re: Association broken when upgrading from rails 1.2.6 to 2.2.2

2009-03-06 Thread gundestrup
Error: You have a nil object when you didn't expect it! The error occurred while evaluating nil.name the view <%= link_to course.semester.name, :controller => 'reporting', :action => 'new', :id => course.id %> the database: courses --- name semester_id semesters n

[Rails] Re: Association broken when upgrading from rails 1.2.6 to 2.2.2

2009-03-06 Thread gundestrup
Error: You have a nil object when you didn't expect it! The error occurred while evaluating nil.name the view <%= link_to course.semester.name, :controller => 'reporting', :action => 'new', :id => course.id %> the database: On Mar 6, 11:35 am, Frederick Cheung wrote: > On Mar 6, 9:35 am, "g

[Rails] Re: upload file to save

2009-03-06 Thread MaD
well, you got a few errors here and there. for example: path = File.join(directory, user.user_id, filename) i guess user doesn't have a user_id but an id, so try: path = File.join(directory, user.id, filename) if you post your error-message, we can try to get there step by step. but in genera

[Rails] Re: comprehension question about controllers

2009-03-06 Thread Heinz Strunk
Thanks, I'll have a look. -- 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

[Rails] Re: upload file to save

2009-03-06 Thread norricorp
I tried this and got an error. My stuff was based on this website - http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm. I wanted a photo stored in images/user-id/ whereas this only uses images/. So if I remove the user-id directory, and do this, I still get an empty file. Thanks

[Rails] Re: comprehension question about controllers

2009-03-06 Thread Colin Law
I would suggest you have a look at http://www.rubyrailways.com/great-ruby-on-rails-rest-resources/ 2009/3/6 Heinz Strunk > > No opinions? > -- > Posted via http://www.ruby-forum.com/. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscri

[Rails] Re: how to catch AJAX calls on session-timeout?

2009-03-06 Thread MaD
i'm gonna try that. thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send ema

[Rails] Re: comprehension question about controllers

2009-03-06 Thread Heinz Strunk
No opinions? -- 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 unsubscri

[Rails] Re: How to pass current value of form field in link_to?

2009-03-06 Thread Jeba Momin
John Yerhot wrote: > try this: > > <%= link_to "Preview Post", {:action => :preview, :id => @topic.id}, > {:onclick => "this.href +='?body='+encodeURIComponent($F > ('id_of_the_form_element')); return true", :id => 'link', :target => > "_blank"} %> Hi John, I have a similar requirement. I need

[Rails] Re: routes.rb ... killing the apps ??

2009-03-06 Thread Simone R.
Matt Jones wrote: > I agree with this - the problem you ran into was that the routes file > didn't get reloaded correctly. This is a known issue (see > http://rails.lighthouseapp.com/projects/8994/tickets/981-fix-for-routing-optimization-code > ) with the 2.1 series. I would *highly* recommend tha

[Rails] Re: Gem update problem

2009-03-06 Thread Jose vicente Ribera pellicer
Jose vicente Ribera pellicer wrote: > solved with gem install ar_mailer Ummm, not solvd at all. Now I can use my localhost but when I try to update my gems I see the same error. :( I can work fine, but i don't like to see this kinds of errors when i try to update my gems. Any help please? --

[Rails] Re: How can i know weather a record is saved or not?

2009-03-06 Thread --- z...@m ---
> You can do record.new_record? to check if it is a new record Thank you thats what i want ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyon

[Rails] Re: errors when asking for index.html

2009-03-06 Thread Luca Scaljery
Frederick Cheung wrote: > On Mar 6, 7:49�am, Luca Scaljery > wrote: >> Hi All >> >> I'm trying setup a RoR project. So far I've only done some HTML stuff >> (nothing with controller, models etc) >> > Looks like your index.html is referencing a javascript file that > doesn't exist (at least not at

[Rails] SQL Console to View

2009-03-06 Thread Lubomir Herko
Hi, I have one request.. is there any way, how can I display SQL console results in view? I mean, for example I have PostgreSQL server, and a simple form, where user can put any SQL command, which will be executed via ActiveRecord::Base.connection.execute(sql) and the actual response (if possible)

[Rails] Re: Error during rake db:migrate

2009-03-06 Thread Dharmdip Rathod
install gem 'name ' =>gem install mysql or dowanload for your rails version and install locally from rubyforge and put it in your root directory c://gem install -l mysql -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message be

[Rails] Deleting images with attachment_fu

2009-03-06 Thread Richard Yoo
Hi I'm trying to delete a user's profile image that was uploaded with attachment_fu directly to storage, without going to the view of the Photo controller. Basically the model is set up so user has many photos photos belong to user @user = User.find(params[:id]) @photo = Photo.new(para

[Rails] Re: Advanced Search In Ruby on Rails.

2009-03-06 Thread Frederick Cheung
> <%= stylesheet_link_tag 'dynamicStyling' %> > You're going have to trim this down a lot - people answer questions on this list out of good will and for most people that doesn't include reading 500+ lines of code. I will say this: global variables yuck, I hope all those * symbols aren't actually

[Rails] Re: RoR for dummies .. from nothing to knowlege

2009-03-06 Thread Simone R.
MaD wrote: > # controller: > def show_all_models > # require all of your models so they get loaded > Dir.glob(RAILS_ROOT + '/app/models/*.rb').each { |file| require > file } > # find all subclasses of ActiveRecord > @all_models = Object.subclasses_of(ActiveRecord::Base) > end > > # view:

[Rails] Re: errors when asking for index.html

2009-03-06 Thread Frederick Cheung
On Mar 6, 7:49 am, Luca Scaljery wrote: > Hi All > > I'm trying setup a RoR project. So far I've only done some HTML stuff > (nothing with controller, models etc) > Looks like your index.html is referencing a javascript file that doesn't exist (at least not at the location you've asked for). F

[Rails] Re: how to catch AJAX calls on session-timeout?

2009-03-06 Thread Frederick Cheung
On Mar 6, 8:31 am, MaD wrote: > hallo everybody, > > my problem is the following: > on one of our rails-apps we implemented session-expiry, so that the > user gets redirected to our login-page whenever his session has timed- > out. this is working fine for normal http-requests. however, for AJA

[Rails] Re: Association broken when upgrading from rails 1.2.6 to 2.2.2

2009-03-06 Thread Frederick Cheung
On Mar 6, 9:35 am, "gundest...@gmail.com" wrote: > In my old app (rails 1.2.6) I was able to access variables via > > controller > @courses = Course.find(:all) > > view file: > <% for course in @courses %> > <%= course.name %> <- this line works > <%= course.semester.name %> <- this is now broke

[Rails] How to populate form dropdown with 2nd item of model

2009-03-06 Thread ChrisYo
I'm trying to create a dropdown list that's populated from a model but which has the 2nd item in the model as the default selection. This is possible. Here's the model snippet. PROPERTY_TYPES = [['Choose', ''], ['Residential', 'Residential'],

[Rails] Re: Gem update problem

2009-03-06 Thread Jose vicente Ribera pellicer
solved with gem install ar_mailer -- 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@googlegr

[Rails] Re: database question

2009-03-06 Thread Pesho Petrov
lol, that's great! THANKS A LOT, Colin ! ! ! Have a great weekend :) Petar -- 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 gro

[Rails] Re: database question

2009-03-06 Thread Colin Law
2009/3/6 Pesho Petrov > > Colin Law wrote: > > > Yes. The question is, of course, has any of this helped with your > > original > > question? I think it has as you can now find all messages where the > > membership.role_id is admin and membership.member_id is the member you > > want > > yes, we

[Rails] Re: How can i know weather a record is saved or not?

2009-03-06 Thread Franz Strebel
On Fri, Mar 6, 2009 at 10:52 AM, --- z...@m --- wrote: > >> record.save? will return Boolean. > > i just want to know weather it is saved ? i don want to save it or try > to save it ! You can do record.new_record? to check if it is a new record --~--~-~--~~~---~--~--

[Rails] Re: database question

2009-03-06 Thread Pesho Petrov
Colin Law wrote: > Yes. The question is, of course, has any of this helped with your > original > question? I think it has as you can now find all messages where the > membership.role_id is admin and membership.member_id is the member you > want yes, we are back to the first question :) you a

[Rails] Re: How can i know weather a record is saved or not?

2009-03-06 Thread MaD
> i just want to know weather it is saved ? > i don want to save it or try to save it ! well, if you dont try to save it, the answer to your question is quite easy: no. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: How can i know weather a record is saved or not?

2009-03-06 Thread --- z...@m ---
> record.save? will return Boolean. i just want to know weather it is saved ? i don want to save it or try to save it ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this gr

[Rails] Re: Replace

2009-03-06 Thread Franz Strebel
On Fri, Mar 6, 2009 at 10:35 AM, Fresh Mix wrote: > > What is the easiest way to replace record in database? > > Better that this: > > @old = Order.find(5) > @new = Order.find(90) > > @old.x = @new.x > @old.y = @new.y @old.attributes = @new.attributes or you can even get rid of @new completely

[Rails] Replace

2009-03-06 Thread Fresh Mix
What is the easiest way to replace record in database? Better that this: @old = Order.find(5) @new = Order.find(90) @old.x = @new.x @old.y = @new.y @old.z = @new.z @old.w = @new.w @old.p = @new.p @old.r = @new.r ... @old.save So now @old = @new except @old.id and @old.created_at -- Posted v

[Rails] Association broken when upgrading from rails 1.2.6 to 2.2.2

2009-03-06 Thread gundest...@gmail.com
I have an app with the following models: course belongs_to :semester semester has_many: courses belongs_to :education education has_many :semesters In my old app (rails 1.2.6) I was able to access variables via controller @courses = Course.find(:all) view file: <% for course in @courses %> <%

[Rails] Gem update problem

2009-03-06 Thread Jose vicente Ribera pellicer
Hi, firs at all sorry if my english is not the best. I'm working with OSX and i have a problem trying to launc localhost. In mongrel.log i can see this message: Agent Log is found in /Users/jose/rankia/log/newrelic_agent.3000.log /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_origi

[Rails] Re: to get multiple check_box values in controller

2009-03-06 Thread Darren Jeacocke
Is there a way to have this working while being able to use labels, and being valid HTML? Ie, unique IDs for the inputs? > no - you want the output to be > > type="checkbox" value="3" /> > > and then params[:user][:language_id] will be an array > > Fred -- Posted via http://www.ruby-forum.

[Rails] Re: Connection Pooling on Rails 2.2.2 (Windows Vista)

2009-03-06 Thread Chris Kottom
In order to take advantage of connection pooling, you need an adapter that supports multithreading. The basic MySQL adapter doesn't do that. Check out http://github.com/methodmissing/mysqlplus_adapter/tree/master for a pretty detailed walkthrough to set this up. On Thu, Mar 5, 2009 at 4:09 PM, s

[Rails] Re: before_filter :action_name OR :action_name

2009-03-06 Thread Colin Law
You could just have one new filter that calls the other two as appropriate. 2009/3/6 Frederick Cheung > > > > On Mar 5, 11:46 pm, Shuaib85 wrote: > > basically, I made my own user access level. In one case, the admin and > > the client can delete their posts. so I do not want to rewrite the > >

[Rails] Re: database question

2009-03-06 Thread Colin Law
2009/3/5 Pesho Petrov > > Colin Law wrote: > > Am I right in thinking that the member/group combination for a message > > is > > always the same member/group that appears in a membership record? If so > > then would it be better to have > > > > Membership: > > has_many :messages > > belongs_to :

[Rails] Re: How to speed up ActiveResource?

2009-03-06 Thread Michael Rigart
Robert Walker wrote: > Michael Rigart wrote: >> I' running in production. I have noticed that development is slower then >> production, but the production speed is still far from acceptable. The >> diffrence between using ActiveRecord and ActiveResource is huge. > > Yep, web services are genera

[Rails] how to catch AJAX calls on session-timeout?

2009-03-06 Thread MaD
hallo everybody, my problem is the following: on one of our rails-apps we implemented session-expiry, so that the user gets redirected to our login-page whenever his session has timed- out. this is working fine for normal http-requests. however, for AJAX- calls that only update a certain div of t

[Rails] Re: Redbox basic implementation question

2009-03-06 Thread Tonypm
Have a look at http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f08f412c04e20ed1/d9f22348d07245f5?lnk=gst&q=++Open+a+(redbox)+modal+popup+from+inside+a+controller%3F++#d9f22348d07245f5 This was a quickfix, I haven't gone to great lengths to investigate the js code, but the ch

<    1   2