[Rails] Re: [Rails]

2009-09-15 Thread Abhinav Saxena
Question1: Where is your question? Question2: How it is related to rails ? Question3: Did you try Google/Bing/Yahoo! search ? -- अभिनव http://twitter.com/abhinav On Wed, Sep 16, 2009 at 9:46 AM, prashanth hiremath < prashanthhirema...@gmail.com> wrote: > Hi > > > I have an lat lon

[Rails] observe_field on multiple select box.

2009-09-15 Thread Salil Gaikwad
Hi All, I want to use observe_field on multiple select box. following is my code <%= select_tag 'usa[states][]', options_from_collection_for_select(state, :state, :state, nil), :multiple => true, :class=>"multi_select" %> <%= observe_field :usa_states_ , :url =>{:controller=>"logins",:action =>

[Rails] RailRoad problem

2009-09-15 Thread Kostas L.
Hi guys! I am having a problem using railroad gem while running the command: railroad -C | neato -Tpng > controllers.png i get this error: c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependenci es.rb:445:in `load_missing_constant': uninitialized constant AdminSessionsCo

[Rails]

2009-09-15 Thread prashanth hiremath
Hi I have an lat long for an example city name newyork with area ,my task is to find the 15 km surroundings for the given lat long. All the lat ,long ,area and city name is in another text file.I want to pull the area lat long from text file which matches 15 km surrounding for give

[Rails] Re: Mysql Can't Connect

2009-09-15 Thread Kevin M
Thanks for the advice, I had that "duh" moment when I read it...having my Rails apps in the MAMP folder messed up the mysql settings. I moved my Rails app to the Sites folder on my Mac, I was able to get mysql to work. Now I'm having problems with my settings somewhere, my browser is giving me th

[Rails] Re: Already initialized constant in Rails 2.3.4

2009-09-15 Thread Jeffrey L. Taylor
Yes, and apparently other changes. Applying the patches to 2.3.3 works for me. 2.3.4 throws the warning in the original post. All my automated tests pass, but I am still nervous about running w/ a warning I don't understand. Hence the test of a patched 2.3.3. Works for me. Jeffreyt Quoting s

[Rails] Re: jruby and ruby on rails corelation

2009-09-15 Thread Robert Walker
lali wrote: > j2ee is quite heavy and bogus not easily usable language. > however j2ee can work with very heavy sun boxes, due to this reason > ruby has a swing calss jruby. > how can we use some of the features f jruby with ruby on rails > environment. > a system level discussion is required for

[Rails] Re: PDF document viewer in rails

2009-09-15 Thread Robert Walker
Marnen Laibow-Koser wrote: > Don't do this. Scribd's PDF viewer is an impressive piece of Flash, but > it's underpowered compared to real PDF viewers like the Adobe Reader > plugin. Also, iPhone and Palm users can display PDF files but not > Flash, and I think screen readers would have an eas

[Rails] Re: Strange error no idea -fileutils.rbThumbs.db (Errno::EACCES)

2009-09-15 Thread Arthur Rats
tried to delete thumbs.db, went to registry and set to show hidden, disabled thumb cache, set superhiden files to show - deleted the thumbs.db and tried agagin, still failed. copied the source files to a new dir, ran mongrel, worked, closed mongrel and started again same issue, thumbs.db isnt

[Rails] Re: 2 submit buttons, how to identify which pressed in the

2009-09-15 Thread Ar Chron
Robert Walker wrote: > Here's a hint: Submit a form and look at the development.log. You can > see clearly what was sent in the params hash. Incidentally this works > for any request sent to your Rails app. There you go again, teaching people how to fish... Pretty soon they will all be reading

[Rails] Re: hidden fields

2009-09-15 Thread Ar Chron
You could go with active_record_store for your session data. Check out ActionController::Base at http://api.rubyonrails.org/ -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Strange error no idea -fileutils.rbThumbs.db (Errno::EACCES)

2009-09-15 Thread Arthur Rats
I can not find a single post on this but trying to start mongrel_rails after closing it down I get the strangest error I have ever seen. Nothing on Google anywhere at all - please can somebody give some expertise? D:\2_Rails_WWW\rails_apps\footballstars>mongrel_rails start ** Starting Mongrel lis

[Rails] Re: validates_uniqueness_of :scope => association

2009-09-15 Thread Patrick Doyle
On Tue, Sep 15, 2009 at 5:57 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > > Basically, I want to ensure that identifiers are unique for a given part. > > Well validates uniqueness of wants scope to be column, so give it one > (part_id) ! > > Fred > Oh... duh! (sheepishly creeps

[Rails] Wrong soap4r interpretation of a WSDL

2009-09-15 Thread PierreW
Hi guys, I had a piece of code that was working perfectly fine. I went on to work on something else in my app, updated a few gems in the process... Now the first bit of code doesn't work anymore, and I am lost. It seems soap4r has decided to do things wrong - but I don't know which gem is impacti

[Rails] Re: Image thumbnails

2009-09-15 Thread Greg Donald
On Tue, Sep 15, 2009 at 1:30 PM, camokatu wrote: > I am trying to create image thumbnails and found this script: > http://www.cleverleap.com/ruby-thumbnail-generator/. Looks like image > is being scaled down and copied to cache folder, however nothing is > being displayed. I particularly don't un

[Rails] Re: validates_uniqueness_of :scope => association

2009-09-15 Thread Frederick Cheung
On Sep 15, 9:44 pm, Patrick Doyle wrote: > ...but (not surprisingly) when I run my unit test, I get: > > ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: > lots.part > > Basically, I want to ensure that identifiers are unique for a given part. > > I think I'm going to have

[Rails] validates_uniqueness_of :scope => association

2009-09-15 Thread Patrick Doyle
(How?) Is it possible to use validates_uniqueness_of with a scope that is a belongs_to association? This is what I would like to do: class Lot < ActiveRecord::Base belongs_to :part, :include => true validates_uniqueness_of :identifier, :scope => :part end ...but (not surprisingly) when I run

[Rails] Image thumbnails

2009-09-15 Thread camokatu
Hi, I am trying to create image thumbnails and found this script: http://www.cleverleap.com/ruby-thumbnail-generator/. Looks like image is being scaled down and copied to cache folder, however nothing is being displayed. I particularly don't understand this piece of code: cgi = CGI.new cgi.out("

[Rails] Re: precision multi-page printing

2009-09-15 Thread Marnen Laibow-Koser
Craig White wrote: > I am at a point where I will need to print checks in an application. > > I guess the best way to describe this is that I am using pre-printed > checks and that I want to hit the prescribed areas with my text output. > > Should I be doing something like PDF output like pdf-wr

[Rails] Re: hidden fields

2009-09-15 Thread Craig White
On Tue, 2009-09-15 at 02:21 +0200, Ar Chron wrote: > Craig White wrote: > > ... because I don't want them tampered with. > > > > Then keep that info server-side. not sure what you mean by this. do you mean put them into the session? do you mean put them into a temporary storage table, per

[Rails] precision multi-page printing

2009-09-15 Thread Craig White
I am at a point where I will need to print checks in an application. I guess the best way to describe this is that I am using pre-printed checks and that I want to hit the prescribed areas with my text output. Should I be doing something like PDF output like pdf-writer or other or can I possibly

[Rails] Re: Already initialized constant in Rails 2.3.4

2009-09-15 Thread st23am
wasn't the patches to 2.3.3 applied via 2.3.4 ?? On Sep 10, 10:20 am, "Jeffrey L. Taylor" wrote: > Links to patches > here:http://www.rorsecurity.info/journal/2009/9/4/two-vulnerabilities-fixe... > > Quoting Jeffrey L. Taylor : > > > > > I worked around the problem by applying the patches to 2.

[Rails] Re: Already initialized constant in Rails 2.3.4

2009-09-15 Thread st23am
wasn't the patches to 2.3.3 applied via 2.3.4 ?? On Sep 10, 10:20 am, "Jeffrey L. Taylor" wrote: > Links to patches > here:http://www.rorsecurity.info/journal/2009/9/4/two-vulnerabilities-fixe... > > Quoting Jeffrey L. Taylor : > > > > > I worked around the problem by applying the patches to 2.

[Rails] Re: Class variables and servers

2009-09-15 Thread Florian Aßmann
Hi Hans, processes don't know each other and i.g. you can't control which instance of your Application responds to the next request, this means: Apache (T=0) | + < Application (Process 0) | @@flock = nil | | + > Fork'd Application (Process 1) | @@flock = nil | + > Fork'd Application (P

[Rails] Re: How can I create a column of bigint sql type in migratio

2009-09-15 Thread Steve Rawlinson
>> I want to use bigint sql type for a model's id. How can I do this in >> migration? Should I just use the integer ruby type? > > Just use > t.integer :foo, :limit => 8 I'm pretty sure that doesn't do what you think it does. It creates a an int(8) in mysql (as opposed to the default which i

[Rails] Re: Unit Testing of Routes

2009-09-15 Thread icke
Rob and Matt, Thanks for your reply. I have now got my head around this now, and have now traced where my routing problem is and now have an reusable test to check I don't break things by changing routes.rb in future. Rob, having a real-life example was what I was really looking for in the docum

[Rails] Re: User login and authentication

2009-09-15 Thread heimdull
+1 for Authlogic (and if you want roles too try acl9) --~--~-~--~~~---~--~~ You received 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

[Rails] Re: accesing post array

2009-09-15 Thread jask
On Sep 14, 4:12 pm, "David A. Black" wrote: > Hi -- > > On Mon, 14 Sep 2009, Pardee, Roy wrote: > > > I think you want to use the fields_for helper so rails will give you > > an array of form params to hold the various items.  You should also > > probably include a hidden text field in there to

[Rails] cruisecontrol.rb and metric_fu

2009-09-15 Thread phibo
i want to use cruisecontrol.rb to run ‘rake test’ (every time a new revision is in the svn repo) and ‘rake metrics:all’ (let’s say every 24 hours). how do i have to configure cruisecontrol.rb? both rake tasks work. however, when i configure cruisecontrol.rb as described on the metric_fu website, i

[Rails] Re: User login and authentication

2009-09-15 Thread Marnen Laibow-Koser
phibo wrote: > hi rick, > > thanks for the help, read the sites with great interest! for my > project, we won't need authorization, basic (but strong, i.e., bcrypt > strong) authentication will do. do you use either of these tools? > > - Clearance > - restful-authentication > - Authlogic > > I

[Rails] Re: Finding unique matches between two tables

2009-09-15 Thread Marnen Laibow-Koser
Aldric Giacomoni wrote: > Frederick Cheung wrote: > >> If they are two separate databases then you'll probably have to do >> this mostly in ruby (ie grab a record from one table then see if it >> exists in the other table). If both tables were in the same database >> you could probably write this

[Rails] Flex plugin for rails

2009-09-15 Thread Avi
Hi, Im pretty sure Im missing something terribly, I've been looking around for a flex plugin for rails which can work easily and which can optimize considerable amount of data transfer, and am confused between rubyamf and weborb. Or if something else has come up new and awesome then nothing bette

[Rails] Finding unique matches between two tables

2009-09-15 Thread Aldric Giacomoni
This may be very simple, but I'm getting my feet tangled within Rails. How do I find the unique matches (same name, dob, ssn) between two tables? CREATE TABLE "patientsingm" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "last" varchar(255), "first" varchar(255), "displayed_name" varchar(255),

[Rails] Re: Finding unique matches between two tables

2009-09-15 Thread Aldric Giacomoni
Frederick Cheung wrote: > On Sep 15, 4:26�pm, Aldric Giacomoni s.net> wrote: >> solution? >> How do I execute pure SQL from within Rails? Do I have to use DBI? >> > > YourModel.connection.execute > > But you can't do it with pure sql if the tables are in different > databases. Of course the ult

[Rails] Re: Finding unique matches between two tables

2009-09-15 Thread Frederick Cheung
On Sep 15, 4:26 pm, Aldric Giacomoni wrote: > Frederick Cheung wrote: > > If they are two separate databases then you'll probably have to do > > this mostly in ruby (ie grab a record from one table then see if it > > exists in the other table). If both tables were in the same database > > you c

[Rails] Re: Form helpers and partial

2009-09-15 Thread Frederick Cheung
On Sep 15, 4:30 pm, "John T." wrote: > John T. wrote: > > > edit.html.erb: > > <% form_for(@course) do |f| %> > >   <%= render :partial => f %> > >   <%= f.submit "Update" %> > > <% end %> > > > _form.html.erb: > > Title: <%= f.text_field :title %> > > Well, slight update. I found that if I chang

[Rails] Re: Unit Testing of Routes

2009-09-15 Thread Rob Biedenharn
You need to put those test methods into a Test::Unit::TestCase... On Sep 15, 2009, at 7:23 AM, icke wrote: > > Hi, > > I am trying to pull together a unit testing for routes but I am > getting confused. I have read AWDWR section 21.4 which explains how > to code the assertions. > http://guid

[Rails] Re: 2 submit buttons, how to identify which pressed in the

2009-09-15 Thread Robert Walker
Sijo Kg wrote: > Hi > You can check params[:commit]In first case its value is 'First' > and in second it is 'Second' Here's a hint: Submit a form and look at the development.log. You can see clearly what was sent in the params hash. Incidentally this works for any request sent to your

[Rails] Re: Form helpers and partial

2009-09-15 Thread John T.
John T. wrote: > Hi, > > I'm trying to use a partial in my form (Rails 2.3.4), and the docs I see > say I can do this: > > edit.html.erb: > <% form_for(@course) do |f| %> > <%= render :partial => f %> > <%= f.submit "Update" %> > <% end %> > > _form.html.erb: > Title: <%= f.text_field :titl

[Rails] Re: Finding unique matches between two tables

2009-09-15 Thread Aldric Giacomoni
Frederick Cheung wrote: > If they are two separate databases then you'll probably have to do > this mostly in ruby (ie grab a record from one table then see if it > exists in the other table). If both tables were in the same database > you could probably write this as a join, but not if the table

[Rails] Form helpers and partial

2009-09-15 Thread John T.
Hi, I'm trying to use a partial in my form (Rails 2.3.4), and the docs I see say I can do this: edit.html.erb: <% form_for(@course) do |f| %> <%= render :partial => f %> <%= f.submit "Update" %> <% end %> _form.html.erb: Title: <%= f.text_field :title %> But when I go to the edit page I ge

[Rails] Re: Finding unique matches between two tables

2009-09-15 Thread Frederick Cheung
On Sep 15, 4:03 pm, Aldric Giacomoni wrote: > This may be very simple, but I'm getting my feet tangled within Rails. > How do I find the unique matches (same name, dob, ssn) between two > tables? > > > class GMPatient < ActiveRecord::Base >   establish_connection "gm" >   set_table_name "patien

[Rails] Re: Unit Testing of Routes

2009-09-15 Thread Matt Jones
The example in the guide does the testing in a functional test, where the routing system is already loaded. I'd recommend that you do the same. --Matt Jones On Sep 15, 7:23 am, icke wrote: > Hi, > > I am trying to pull together a unit testing for routes but I am > getting confused.  I have read

[Rails] Re: Before_Filter question

2009-09-15 Thread Frederick Cheung
On Sep 15, 3:37 pm, Hemant Bhargava wrote: > Not working .. In this case .. authorize_admin starts works .. > Listen my case is if user is admin then show him all pages like :abc and > :def and :xyz and if user is a simple user then show him only :abc and > if user is an tailor then show him tw

[Rails] constant error in active_resource/base

2009-09-15 Thread quinn
I am using activeresource 2.3.3 I was using ActiveResource today and it seemed to be choking on namespaced xml, like this: on line 1057 it erred with "Wrong constant name Media:group" first i tried on line 1048 name = name.to_s.gsub(':','/') which started failing in the same place but with: "

[Rails] Re: Hypothetical Question about Views

2009-09-15 Thread Frederick Cheung
On Sep 14, 10:54 pm, Kendall Buchanan wrote: > Frederick Cheung wrote: > How do you deal with wanting three different views for the same data? Do > you use three separate controller actions? I would. Sounds like it would be clearer than fiddling with respond_to. Obviously you'd want to share t

[Rails] Re: Before_Filter question

2009-09-15 Thread Hemant Bhargava
Not working .. In this case .. authorize_admin starts works .. Listen my case is if user is admin then show him all pages like :abc and :def and :xyz and if user is a simple user then show him only :abc and if user is an tailor then show him two pages :abc and :def .. All pages can be accessed b

[Rails] Re: Hypothetical Question about Views

2009-09-15 Thread Robert Walker
Kendall Buchanan wrote: > def index > @thing = Thing.all > > respond_to do |format| > format.first_view > format.second_view > format.third_view > end > end > > I have a hunch, however, that separate mime types for different views is > inappropriate, or is this good? Any though

[Rails] Rails & .ejs.erb

2009-09-15 Thread aa bb
I have some trouble using this type of tools, the format.js from to the controllers to the {action}.js.erb in the view files… Trying to put some onubtrusiveness int my developpment… Everything's working smoothly… except that at some point, navigating from page to page through those javascript setu

[Rails] Re: adding a ruby library built using swig

2009-09-15 Thread Lyes Amazouz
Hello! It is all clear now I have put the .so file generated by swig in the "#{RAILS_ROOT}/lib" directory, now it recognizes it and every thing works fine thank you On Tue, Sep 15, 2009 at 1:27 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > > On Sep 14, 1:15 pm, Lyes Amazouz

[Rails] Re: Before_Filter question

2009-09-15 Thread Abhinav Saxena
before_filter :authorize_admin, :except => [:def, :xyz] before_filter :authorize_tailer, :only => [:def, :xyz] # if you have a method authorize_tailer Thanks, Abhinav -- अभिनव http://twitter.com/abhinav On Tue, Sep 15, 2009 at 6:07 PM, Hemant Bhargava < rails-mailing-l...@andreas-s.net> wrote:

[Rails] Re: Before_Filter question

2009-09-15 Thread Robert Walker
Hemant Bhargava wrote: > Thats correct that :except can be an array of values but if gave them > user can also see access the pages .. even if he is neither a admin nor > tailor .. > you mean to say that i have to do in this way .. > before_filter :authorize_admin, :except => [:def, :xyz] Take

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar
Please correct me if I'm wrong method after_validation collects all the error messages of club model and rejects the first error message, which is "club is invalid" and collects the remaining messages into variable and adds them to the error list. Saurabh -- Posted via http://www.ruby-foru

[Rails] Re: Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch

2009-09-15 Thread Sandip Ransing
What is current trace...? --Sandip --~--~-~--~~~---~--~~ You received 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, s

[Rails] Re: User login and authentication

2009-09-15 Thread phibo
hi rick, thanks for the help, read the sites with great interest! for my project, we won't need authorization, basic (but strong, i.e., bcrypt strong) authentication will do. do you use either of these tools? - Clearance - restful-authentication - Authlogic I can't figure out which to use/try f

[Rails] Re: Before_Filter question

2009-09-15 Thread Hemant Bhargava
Thats correct that :except can be an array of values but if gave them user can also see access the pages .. even if he is neither a admin nor tailor .. you mean to say that i have to do in this way .. before_filter :authorize_admin, :except => [:def, :xyz] Frederick Cheung wrote: > On Sep 15,

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Saurabh Peshkar wrote: > try this out, > > in user.rb > > def after_validation > variable = self.errors.reject{ |err| %w{club }.include?(err.first) } > self.errors.clear > variable.each { |err| self.errors.add(*err) } > end > > might work. hi Saurabh, it is now working properl

[Rails] Liquid assign_to

2009-09-15 Thread Vincent Bakker
Hello using liquid markup i am trying to do the following. {{ 'holiday' | album_thumbs | assign_to 'asset_list' }} {% for asset in asset_list %} "link: " + {{ asset | asset_path }} {% endfor %} It should return a list with all assets for the loop, but the asset_list variable never gets set.

[Rails] Re: Association problem

2009-09-15 Thread Doloo
This is a example. I solve it. Thank you. On Sep 15, 9:25 pm, Frederick Cheung wrote: > On Sep 15, 12:22 pm, Doloo wrote: > > > So when i trying add new product. I get errors. > > # products_controller.rb > >   def new > >     @product = current_user.product_groups.products.build > >   end > >

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar
try this out, in user.rb def after_validation variable = self.errors.reject{ |err| %w{club }.include?(err.first) } self.errors.clear variable.each { |err| self.errors.add(*err) } end might work. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---

[Rails] Re: Before_Filter question

2009-09-15 Thread Frederick Cheung
On Sep 15, 1:18 pm, Hemant Bhargava wrote: > Guyz, > > I am having a question for you.. > Scenario is i am using before_filter in controller ABC to check that > wheather user is administrator or not .. and if not then it can show > user only one page to user .. did it like this.. > before_filte

[Rails] Re: adding a ruby library built using swig

2009-09-15 Thread Frederick Cheung
On Sep 14, 1:15 pm, Lyes Amazouz wrote: > Hello! > > I have wrapped a c library I have made into ruby using swig > now I want to use it in a rails project > > I have already tested my library with a ruby script and it worked well > > I added the path to the swig generated library in my script a

[Rails] Re: Association problem

2009-09-15 Thread Frederick Cheung
On Sep 15, 12:22 pm, Doloo wrote: > So when i trying add new product. I get errors. > # products_controller.rb >   def new >     @product = current_user.product_groups.products.build >   end > The error I'm receiving is: > >    NoMethodError (undefined method `products' for #): >      app/control

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Saurabh Peshkar wrote: > Preksha Patel wrote: >> Saurabh Peshkar wrote: >>> what message you get, if you remove :message => nil after >>> validates_associate :club >> >> if i remove :message => nil then i get the message "club is invalid" > > I'm not getting what exact message you want? now al

[Rails] Association problem

2009-09-15 Thread Doloo
Hi, I'm new to ruby on rails. So i think i have association problems. Given the three model classes with their associations: # user.rb class User < ActiveRecord::Base has_many :product_groups has_many :products, :through=>:product_groups end # product_group.rb class ProductGroup < ActiveRec

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar
Preksha Patel wrote: > Saurabh Peshkar wrote: >> what message you get, if you remove :message => nil after >> validates_associate :club > > if i remove :message => nil then i get the message "club is invalid" I'm not getting what exact message you want? -- Posted via http://www.ruby-forum.com/

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Saurabh Peshkar wrote: > what message you get, if you remove :message => nil after > validates_associate :club if i remove :message => nil then i get the message "club is invalid" -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this

[Rails] Before_Filter question

2009-09-15 Thread Hemant Bhargava
Guyz, I am having a question for you.. Scenario is i am using before_filter in controller ABC to check that wheather user is administrator or not .. and if not then it can show user only one page to user .. did it like this.. before_filter :authorize_admin, :except => :def Now i want a condition

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar
what message you get, if you remove :message => nil after validates_associate :club -- 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

[Rails] Re: PDF document viewer in rails

2009-09-15 Thread Marnen Laibow-Koser
mahesh s wrote: > Hi sijo > thank you it help me some way but what i really need is i would like to > show the content in the flash player like this url shows > http://www.scribd.com/doc/18244537/The-World-According-to-Twitter Don't do this. Scribd's PDF viewer is an impressive piece of Flash,

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Preksha Patel wrote: > Saurabh Peshkar wrote: >> Is the code working properly? > > hi if i don't fill any field then error messages are displayed for both > the model but also one message "club nil" as i wrote > validates_associated :club, :message => 'nil' in users model..and if i > fill data

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Saurabh Peshkar wrote: > Is the code working properly? hi if i don't fill any field then error messages are displayed for both the model but also one message "club nil" as i wrote validates_associated :club, :message => 'nil' in users model..and if i fill data only for user model and don't fil

[Rails] Re: setup has_many routes

2009-09-15 Thread Jamal Soueidan
Well, that wasn't hard :-D map.namespace :admin do |admin| admin.resources :projects do |project| project :tasks, :collection => {:assigns => :post} end admin.resources :tasks end -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~---

[Rails] Re: User login and authentication

2009-09-15 Thread Rick
Here are my favorite two summary discussions along with a pointer to a general security site. For my work the distinction between authentication and authorization (user name and user role) is important. I use a combination of plugins and gems to fill my needs since I feel site security is one ar

[Rails] setup has_many routes

2009-09-15 Thread Jamal Soueidan
Hi, I'm trying to accomplices this with REST :) http://localhost:3000/admin/projects/11/tasks/assigns/:user_id This is my route config. map.namespace :admin do |admin| admin.resources :projects, :has_many => {:tasks => {:assigns => :post}} admin.resources :tasks end But I'm not get

[Rails] Unit Testing of Routes

2009-09-15 Thread icke
Hi, I am trying to pull together a unit testing for routes but I am getting confused. I have read AWDWR section 21.4 which explains how to code the assertions. http://guides.rubyonrails.org/testing.html#testing-routes also basically says the same. The problem I have is working out what else I

[Rails] Re: Nested Routes Best Practices

2009-09-15 Thread AppleII717
You are right. I think I just added the :only => [:index] to test the concept. I was trying to point out that even with: map.resources :lists, :shallow => true, :has_many => :items The index action is called and you must handle the situation that this only applies if :item_id is present. In

[Rails] Re: Multiple Nested Resources and Routes

2009-09-15 Thread AppleII717
On Sep 15, 3:44 am, Sijo Kg wrote: > in routes.rb > map.resources :projects do |project| >   project.resources :assessments do |assessment| >     assessment.resources :findings >   end > end > -- I'd consider adding :shallow => true. There is a lot of stuff out there about deeply nested routes

[Rails] Re: [ANN] Learnivore.com, ruby/rails screencasts aggregator

2009-09-15 Thread Thibaut Barrère
> Great job Glad you like it :) RubyPulse has just been added to the mix: http://bit.ly/9LxNH cheers, -- Thibaut --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,

[Rails] Re: adding a ruby library built using swig

2009-09-15 Thread Lyes Amazouz
Please, I need a solution quickly On Mon, Sep 14, 2009 at 1:15 PM, Lyes Amazouz wrote: > > Hello! > > I have wrapped a c library I have made into ruby using swig > now I want to use it in a rails project > > I have already tested my library with a ruby script and it worked well > > I added the p

[Rails] User login and authentication

2009-09-15 Thread phibo
Being a rails newbie, I started to design our first rails-based webapp. This app should not only be used via browsers, but we also want to provide a (RESTful) api. I love the 'convention over configuration' paradigm, but am totally clueless on what to do when it comes to user authentication. Is th

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Abhinav Saxena
Preksha, I guess, you should read this: http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributesHopefully, it will solve your problem. Thanks, Abhinav -- अभिनव http://twitter.com/abhinav On Tue, Sep 15, 2009 at 2:32 PM, Preksha Patel < rails-mailing-l...@andreas-s.net>

[Rails] Re: noob collection_select question

2009-09-15 Thread Daren S Dias Warburton
Spencer Rogers wrote: > Finally found the answer on google. Thanks anyways! Hey Spencer, could you share with me how you managed to save the update to the table? Cheers, docgecko -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received t

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar
Is the code working properly? -- 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

[Rails] Re: [ANN] Learnivore.com, ruby/rails screencasts aggregator

2009-09-15 Thread Colin Law
2009/9/15 Thibaut Barrère : > > Hi, > > a project I've been building on the side: > > http://www.learnivore.com > > It's a screencasts aggregator - so far I've indexed the most well- > known ruby/rails screencasts publishers, including: > - pragprogs > - railscasts > - peepcode > - envycasts > - (

[Rails] Re: PDF document viewer in rails

2009-09-15 Thread Peter De Berdt
On 15 Sep 2009, at 10:51, mahesh s wrote: > thank you it help me some way but what i really need is i would > like to show the content in the flash player like this url shows > http://www.scribd.com/doc/18244537/The-World-According-to-Twitter http://www.google.com/search?q=pdf+flash+viewer

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Preksha Patel wrote: > Saurabh Peshkar wrote: >> Have you commented the line >> >> in club.rb >> validates_associated :user > > no i haven't commented this line.. now i have comment out this line and add this line validates_associated :club, :message => nil in user.rb model -- Posted via http:

[Rails] Re: PDF document viewer in rails

2009-09-15 Thread mahesh s
Hi sijo thank you it help me some way but what i really need is i would like to show the content in the flash player like this url shows http://www.scribd.com/doc/18244537/The-World-According-to-Twitter Thanks & regards Mahesh On Tue, Sep 15, 2009 at 1:56 PM, Sijo Kg wrote: > > Hi mahesh > >

[Rails] Re: Multiple Nested Resources and Routes

2009-09-15 Thread Sijo Kg
Hi Do like in routes.rb map.resources :projects do |project| project.resources :assessments do |assessment| assessment.resources :findings end end Now the helper for /projects/1/assessments/1/findings/1/ is project_assessment_finding_url(projectid,assesmentid,findingid)it will

[Rails] Re: PDF document viewer in rails

2009-09-15 Thread Sijo Kg
Hi mahesh Please check http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000421 An example is send_file 'filepath', :disposition => 'inline',:type => 'application/pdf' Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~---

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Saurabh Peshkar wrote: > Have you commented the line > > in club.rb > validates_associated :user no i haven't commented this line.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Multiple Nested Resources and Routes

2009-09-15 Thread jayoshi13
Hi A noob question on using routes with multiple nested resources - The nested resources are as follows - -> Projects -> Assessments ->Findings A Project has many Assessments, an Assessment has many Findings. At presents it all works well for the following URL - /proj

[Rails] Error "undefined method 'stringify_keys' for "tag1":String" on multi-model form submission

2009-09-15 Thread Jonathan
I'm following the tutorial on http://guides.rubyonrails.org/getting_started.html, and got stuck on the very last section, "Building a Multi-Model Form". I'm trying to do two models in the same form, and I get the following error: undefined method `stringify_keys' for "tag1":String Here is th

[Rails] [ANN] Learnivore.com, ruby/rails screencasts aggregator

2009-09-15 Thread Thibaut Barrère
Hi, a project I've been building on the side: http://www.learnivore.com It's a screencasts aggregator - so far I've indexed the most well- known ruby/rails screencasts publishers, including: - pragprogs - railscasts - peepcode - envycasts - (more, and others are planned) Suggestions (including

[Rails] anyone using Lockdown?

2009-09-15 Thread phil
I've stumbled across this gem that seem to be quite complete for group permissions and rights. The only problem is that there are no examples of how to use it in a real world (eg how to assign permissions from a UI, create permissions and roles on the fly, etc). Has anyone looked into this gem an

[Rails] Re: 2 submit buttons, how to identify which pressed in the controller?

2009-09-15 Thread Sijo Kg
Hi You can check params[:commit]In first case its value is 'First' and in second it is 'Second' Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rai

[Rails] Re: 2 submit buttons, how to identify which pressed in the controller?

2009-09-15 Thread Abhinav Saxena
Although I have never used two form submits in a single form, but perhaps you can use "value" to pass id instead of using params. Thanks, Abhinav -- अभिनव http://twitter.com/abhinav On Tue, Sep 15, 2009 at 12:40 PM, Matt wrote: > > Hi > > I have the following code: ><%= f.submit '

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar
Have you commented the line in club.rb validates_associated :user -- 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 e

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Preksha Patel
Preksha Patel wrote: > Preksha Patel wrote: >> Saurabh Peshkar wrote: >>> Have you written >>> >>> in user.rb >>> >>> has_one :club >>> >>> Saurabh >> >> yes because there is one-to-one relationship between this two model and >> user_id is foreign key in club table.. > > sorry i 4got to ad

[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar
Preksha Patel wrote: > Saurabh Peshkar wrote: >> Have you written >> >> in user.rb >> >> has_one :club >> >> Saurabh > > yes because there is one-to-one relationship between this two model and > user_id is foreign key in club table.. in your shared user.rb, I hadn't seen that line hence I a

  1   2   >