[Rails] Re: Creating formatted PDFs

2012-05-22 Thread Ar Chron
Marc C. wrote in post #1061690: > Except one part: I don't know how to > render correctly the HTML in the PDF file. > > Currently I use the Prawn library to create the PDF's. I use Prawn to generate pdf's, Nokogiri to parse the html portion and created an element_to_pdf method to walk the html, l

[Rails] Re: Calling destroy in a has_many_and_belongs_to and has_many :through

2012-05-22 Thread Ar Chron
Msan Msan wrote in post #1061478: > I've noticed that if I use associations with has_many_and_belongs_to > and i call a destroy method on an object of the association, the > record in the join table is automatically deleted. > If I use has_many :though, for example: > > Category > has_many :categor

[Rails] Re: Multiple references of Country table in single client table

2012-04-27 Thread Ar Chron
akshar jamgaonkar wrote in post #1058608: > Hi I am new to ruby on rails , i am trying to develop a form client > form having multiple refrences to country... i.e while adding a client > i can add two contact persons each have a country associated with > them. However with scaffolding iam unable to

[Rails] Re: Routes - Search url parser

2011-05-09 Thread Ar Chron
danimashu wrote in post #997411: > I would prefer to have a url like that: > - example.com/ford/red > But then what happens with: - example.com/pink/cadillac ? I'd be careful of investing any particular logic behind your urls for dealing with arguments. Do all your users catagorize things th

[Rails] Re: Php to Ruby compilation software

2011-05-04 Thread Ar Chron
Femto Zheng wrote in post #996564: > Hello all, because most of php's application is feature rich than > rails's existing offer, > like say, crm solutions, sugarcrm, > I know rails have similar offering,( fat_free_crm), but unfornately, > this is really far > from the feature sugarcrm offers, > su

[Rails] Re: Migration error

2011-04-28 Thread Ar Chron
amritpal p. wrote in post #995532: > Then ran "rake > db:migrate",it created a new columns in table products with name > "price" ,but i didnt change the view(didnt create a filed with name > "price") Migrations don't do that (you can create migrations

[Rails] Re: Routing Error

2011-04-28 Thread Ar Chron
amritpal p. wrote in post #995520: > On Apr 28, 3:25am, Colin Law wrote: >> >> > root :to => "say#hello" >> >> So you think that the above line, which says route '/' to say#hello' >> is going to route /say/goodbye somewhere? > No it will not route to /say/goodbye,but it will route to

[Rails] Re: NoMethodError in Book

2011-04-26 Thread Ar Chron
amritpal p. wrote in post #995096: > Yes i have tried scafffolding.But i want to generate a form > without scaffold.i want to manualy create a controller,view and model > for it.please help to do it. > > Thanks Yes, fair enough. But use the scaffolded elements as the prototype for your manual cr

[Rails] Re: NoMethodError in Book

2011-04-26 Thread Ar Chron
amritpal p. wrote in post #995086: > Stuff... You seem to be lacking some fundamental "organizational" knowledge as it pertains to a Rails application. What I found very instructive way back when was to scaffold a basic application and see what Rails created, and how it was organized. Then I

[Rails] Re: how to update data

2011-04-18 Thread Ar Chron
News Aanad wrote in post #993479: > hi, I have json string in json request. > i want to update the database using that string. > how can i do that? > There would be a multipal object in this string. > > sample string is: > > [{"product":{"amt":300,"created_at":"2011-03-28T05:46:52Z","id":1,"prodnm

[Rails] Re: How to generate a form in rails 2.3.5

2011-04-18 Thread Ar Chron
amritpal p. wrote in post #993489: >But i didnt explain in which > file it should be written? > > Thanks Well, perhaps you would benefit from seeing a scaffolded response. At an OS prompt, type in: ruby script/generate scaffold person first_name:string las

[Rails] Re: Can join tables be polymorphic?

2011-04-07 Thread Ar Chron
Andy Tolle wrote in post #991031: > For example: > Currently I have: > functions < functions_competencies < competencies > exams < exam_competencies < competencies > > I'd like to dry up "functions_competencies" and "exam_competencies" by > using a polymorphic association, by let's say 'a

[Rails] Re: Need help in changing data in production.

2011-04-07 Thread Ar Chron
Marco Antonio Filho wrote in post #991464: > Now comes the problem. I need to deploy these > changes > in the production servers. I already have the script to update the > changes, > but I don't know what is the conventional place to put it. Not in the > migrations, I know. Why not a migration? S

[Rails] Re: [JOBS] Help build some product in London

2011-03-25 Thread Ar Chron
Nick Marsh wrote in post #989203: > That means no clients or anything Oh but you DO have clients, you just don't know them yet. Involve elements of your projected user base(s) now, and you might find a much higher adoption rate later... -- Posted via http://www.ruby-forum.com/. -- You receiv

[Rails] Re: using a paginate method to display the second group of 25 records on page 2

2011-03-25 Thread Ar Chron
John Merlino wrote in post #989291: > > ((@all_resources.size - 1) / @limit).to_i + 1 > > What does the size method do and why add one at the end? > Suppose 100 records, with a page size of 30 num_pages = ((100-1)/30) num_pages = 99/30 num_pages = 3.3 num_pages = 3 (to_i) num_pages = 4 3 full pa

[Rails] Re: Splitting up a long running task with delayed job

2011-03-24 Thread Ar Chron
bingo bob wrote in post #989039: > anyone done anything like this before? What if you select 100 records per pass in an oldest-update == first-selected order? model.Find(:all, :order => "updated_at DESC", :limit => 100) -- Posted via http://www.ruby-forum.com/. -- You received this message b

[Rails] Re: Nested Models are not connecting/connected

2011-03-17 Thread Ar Chron
R. K. wrote in post #987926: > I'm attempting to make a basic CRUD/data entry cookbook. I've got a > recipe model that is composed of other models. I'm intending of using a > single form to create the recipes such that n ingredients and n > instructions can be associated to a single recipe. > > I u

[Rails] Re: Uninitialized constant Files::Magick -still around

2011-03-17 Thread Ar Chron
Manny 777 wrote in post #987883: > Hi Fred, > thank you for your reply. I tried to edit Gemfile by your hint, but > unfortunatelly, without successful... > > But I found one interesting thing -- if I will to delete content of > Gemfile, my app work normally (but of course, the problem with RMagick

[Rails] Re: [RUBY] how do generate a random number w specific distribution ( which library ?)

2011-03-15 Thread Ar Chron
Colin Law wrote in post #987114: > > But how fast can you do it? > Ooh, that's an evil tweak... (a minor diversion which is much more fun than what I was doing) Lenovo T61p, Core2Duo, T9300, 2.5GHz, ruby 1.9.2-p0 = 0.253025 And for curiosity, my Ubuntu 10.10 VM on top of the same hardware:

[Rails] Re: Re: Fragment caching and not accessing model from view

2011-03-09 Thread Ar Chron
Colin Law wrote in post #986452: > On 9 March 2011 11:54, Frederick Cheung > wrote: > > OK, I provided a scope > scope :all_varieties > with no parameters. > > Then in the controller > @varieties = Variety.all_varieties > and have confirmed that if the fragment is already cached so > @varieties is

[Rails] Re: Page Caching extending it?

2011-02-18 Thread Ar Chron
rails.n...@gmail.com wrote in post #982493: > I guess this could also be done by implementing some sort of Fragment > Cache... wrapping a whole page > > Just not sure where to begin... I don't want to reinvent rails > caching... just want to tweak it with a simple conditional + have > control on th

[Rails] Re: howto implement a join table

2011-02-15 Thread Ar Chron
rogi wrote in post #981715: > Hi There > > I have a table for the names of my workers and a table with the > courses they have attended. > Now I try to create a join table to see which workers attended what > courses. > Assuming you have completed something like this: rails g scaffold worker first_

[Rails] Re: Suggestion to reduce number of junk hierarchical 'if loops'

2011-01-31 Thread Ar Chron
PalaniKannan K wrote in post #978680: You have a few paths which will yield nothing (no executions, no output). if !condition1 - nothing occurs if condition1 and condition2 and !condition3 - nothing occurs if condition1 and !condition2 and !condition6 - nothing occurs Scope your data access (ei

[Rails] Re: counTRY_CODE_SELECT

2011-01-24 Thread Ar Chron
Loganathan S. wrote in post #977147: > Hi, > > I'm new to rails ,the country_code_select plugin is not work in my > rails 3 > application,it just displays an empty select box,how can i correct this. > > Regards, > Loganathan.S Simple! Just correct either your controller, your model, your view co

[Rails] Re: Magick::Image , no size & Amazon S3

2011-01-24 Thread Ar Chron
comopasta Gr wrote in post #977118: > Hi, > > Any ideas why I get "undefined method `size' for 100x100 DirectClass > 8-bit:Magick::Image" while doing the next? > > image = Magick::Image.new(100, 100) { self.size = "100x100"} > logger.info image.size > ... > > This is how I use it normally to stor

[Rails] Re: Rails on Windows, so slow

2011-01-18 Thread Ar Chron
eJay wrote in post #975656: > Frankly I do not want to go to Linux because I will not miss the > editor Photoshop and Gimp for me is not quite acceptable. > > Who uses a Linux? At home, I dual boot Win7 Pro (home stuff and fun stuff) and Ubuntu 10.04 (Rails development work) since the machine is

[Rails] Re: collection_select problem

2011-01-17 Thread Ar Chron
wardenik wrote in post #974738: > <% @users.each do |u| -%> > "> > <%= u.name %>,<%= u.member_status_id %> > <%= collection_select( u, :member_status_id, blah blah blah %> Please, please, please get that collection_select data access out of the view. If you have 100 users, how many times wi

[Rails] Re: Link_to parameters

2011-01-05 Thread Ar Chron
David Zhu wrote in post #972696: > Hello, > > I would like to have a link_to automatically populate a field in the > form that it is linking to. > > For example (excuse my silly words, im trying to make a point) > <%= link_to "Add a COOL Post", new_post_path, :howcoolisit => 'COOL' > %> > <%= link_

[Rails] Re: ActiveRecord aliases 'id' to primary key

2010-12-10 Thread Ar Chron
Pete Campbell wrote in post #967747: > Its a good suggestion but sadly the answer is no. There is another app > that also accesses this data and so I *probably* can't change it. > > Is this behavior expected or not? It was a bit of a surprise to me. > A little unexpected... but the source makes it

[Rails] Re: Rails 3 Active Record query returns "undefined method `loaded?' for #"

2010-12-09 Thread Ar Chron
David Kahn wrote in post #967449: > I am getting this error on an rspec test: > undefined method `loaded?' for # > > When I call: > Practice.includes("practice_members").all > You aren't testing what you think you are... .all returns an array even if it only finds a single instance, and at last

[Rails] Re: Re: beginning web development with ror, how?

2010-12-08 Thread Ar Chron
Umarzuki Bin Mochlis Moktar wrote in post #967122: > thanks Then again, there's always this: Why's Poignant Guide to Ruby... http://mislav.uniqpath.com/poignant-guide/ -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: Again on facebook

2010-12-06 Thread Ar Chron
If YOU don't know how you want to use the data in your application, then why are you asking here??? Why are you even worried about it? If getting Rails/Ruby to hook up to facebook was just a technical exercise to learn an interface, then be done with it. -- Posted via http://www.ruby-forum.c

[Rails] Re: persisting complex (and possibly large) objects

2010-12-02 Thread Ar Chron
Fearless Fool wrote in post #965610: > This question may be so obvious that even Marnen won't answer it... :) > > I need to store a set of relatively complex objects in the db -- in my > case, these are discrete cumulative distribution functions: they take a > long time to construct, but I want the

[Rails] Re: Heroku error msg:App Crashed

2010-11-29 Thread Ar Chron
Emanuel wrote in post #964744: > /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/bundler/ > runtime.rb:64:in > `require': no such file to load -- sqlite3 (LoadError) > > > u can see from the above line...i think it is an error regarding > sqlite3 as i am using it with my application...and

[Rails] Re: Heroku error msg:App Crashed

2010-11-29 Thread Ar Chron
Emanuel wrote in post #964621: > where did it gone wrong? pls help... >From what you've provided, there's no telling what is wrong... it could be anything. Have you looked at any of the log files available? -- Posted via http://www.ruby-forum.com/. -- You received this message because you ar

[Rails] Re: How to select single radio button & multiple checkboxes in RUBY (Watir Frame work), any one help

2010-11-24 Thread Ar Chron
chowdary wrote in post #963540: > RUBY (Watir Frame work) > > from the following Radio buttons i have to select only one radio > button then automatically ramaining should disable. > > sample code for radio button > > Gender : > Male > Female > Other > > > > How to select multiple checkboxes R

[Rails] Re: Better approach to set global values?

2010-11-24 Thread Ar Chron
John N. wrote in post #963524: > > def grab_settings >@set = Setting.first @set.company_name ||= 'My Company' > end > Well, you could always read the Settings, then impose your own defaults inside the grab_settings method. Any code outside that method has no idea whether the value wa

[Rails] Re: Conditional haml vs. erb precedence

2010-11-23 Thread Ar Chron
Brent Miller wrote in post #963232: > During the conversion process, we want to keep the new > views away from most of our users until they're ready for public beta. Umm... yeah, that's called dev environment vs production environment. I've found it far easier to grant a beta a look into the dev

[Rails] Re: technologies needed to learn to be a good ror developer

2010-11-22 Thread Ar Chron
venkata reddy wrote in post #963052: > Hi everybody... >I am venkey here. very interested to learn ruby on > rails.Though i have not had any experience with the web development, > i want to learn ror as quickly as i can.I installed ror successfully.i > am just starting to build sam

[Rails] Re: connect Model not to Controller named as pluarize of model but to another Controller

2010-11-18 Thread Ar Chron
sukury47 wrote in post #962465: > > ps. As i've practiced rails, i thought that > Controller not named as pluarize of model is bad structure of app > is it real? do you think so two? Yes, it annoys me that there are so many examples for Rails like that. In Rails, part of the beauty is the idea of

[Rails] Re: Very confused - scaffold action does - sends NULL to db

2010-11-17 Thread Ar Chron
comopasta Gr wrote in post #962162: > > Do another scaffold named act and everything goes fine with no changes. > I could imagine that action is a reserved word but shouldn't it complain > about it? > > Any hints? I'd imagine that your use of a reserved word has caused the issue, so don't. I am

[Rails] Re: Inheritance alternative

2010-11-06 Thread Ar Chron
Matias Fierro wrote in post #959653: > I have to objects with common functionalities and a lot of difference. > So I want that each have his own table but inherit the common > functionalities from a parent class. How can I do this in Rails ? class GenericModel < ActiveRecord::Base self.abstract_

[Rails] Re: Re: pattern findings using “find” in Rails

2010-10-26 Thread Ar Chron
PalaniKannan K wrote in post #957235: > > I tried > def author_yr > "#{self.author_year.last(4)}" > end. > > But it shows "Undefined local variable or method 'author_yr'" > > when i use author_yr in find by > > ":order => ["author_year like = ?", author_yr]". Please suggest me some > idea > in ord

[Rails] Re: Problem with Sortable Table Columns

2010-10-25 Thread Ar Chron
> > 12| @users = User.find(:all, :order => sort_column + " " + > sort_direction) Well, which value is null, sort_column or sort_direction? Oftentimes, I've seen code that sets the direction for descending, but not ascending, which might be your issue. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: pattern findings using “find” in Rai ls

2010-10-25 Thread Ar Chron
Refactor the DB to have those fields available separately. You have two distinct pieces of data munged together in one field. -- 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 gr

[Rails] Re: Could not find a valid gem 'xaws-s3x' (>= 0) in any repository

2010-10-22 Thread Ar Chron
Peter C. wrote in post #956221: > No, I am using RubyMine. It complains "Gems required for project are > not attached: xaws-s3x (0.4.0)" Can't help you there as I don't use an IDE (tried a number, and they just kept getting in the way). But I assume that there is some sort of gem manager built i

[Rails] Re: 13" MBA or 15" MBP?

2010-10-21 Thread Ar Chron
Alexander H. wrote in post #956067: > > I would be very grateful to hear any comments and recommendations by > developers who have experience with this kind of development on > MacBooks. Screen real estate trumps all (IMHO), but then I'm a visually-oriented person. -- Posted via http://www.ruby

[Rails] Re: print page and Link_to problem

2010-10-20 Thread Ar Chron
Cameron Vessey wrote in post #955866: > > So heres were I go dumb again... I added a print_label view to the > tire view folder ... > "map.resources :tires" does nothing for this new view > I must force the route into tires? >> map.resources :tires generates the 'standard' CRUD routing

[Rails] Re: print page and Link_to problem

2010-10-20 Thread Ar Chron
Cameron Vessey wrote in post #955645: > > The index page has a link_to that looks like > > <%= link_to 'Edit', edit_tire_path(tire) %> > > now maybe I'm missing it but I've tried to find out were the scaffold > put the route or mapping of this edit link_to so that it works. > Try executing a "rake

[Rails] Re: Could not find a valid gem 'xaws-s3x' (>= 0) in any repository

2010-10-19 Thread Ar Chron
Peter C. wrote in post #955385: > Hi > I'm trying to install xaws-s3x but got this error. Any advice or > suggestion is much appreciated. > r...@ubuntu:/d# gem install xaws-s3x > ERROR: Could not find a valid gem 'xaws-s3x' (>= 0) in any repository Do you mean to install aws-s3? What are the 'x'

[Rails] Re: New to RoR. New project with a legacy database and php service. Any tips?

2010-10-19 Thread Ar Chron
William Denniss wrote in post #955352: > Hi All, > > I'm about to jump into Ruby on Rails for a new project, but wanted to > see if anyone has some tips for my specific situation: > > Basically I already have a web service in PHP that communicates with a > non-web based application to sync data bet

[Rails] Re: using custom foreign keys in associations

2010-10-19 Thread Ar Chron
Arun Srini wrote in post #955342: > > class CreateRoomtypes < ActiveRecord::Migration > create_table :roomtypes do |t| > t.string :t_name > t.string :rate > t.string :comment > t.timestamps > end > end > class CreateRooms < ActiveRecord::Migration > create_table

[Rails] Re: Ruby as a web client

2010-10-15 Thread Ar Chron
Alex wrote in post #954625: > Hello, > > I need to write a program that will talk http to some web > applications. I was thinking to use Rack. I am not sure what would be > a good way to do this. Is there a better or higher level gem that I > can use for this. > > > Thanks in advance! > Alex You

[Rails] Re: Noughts and Crosses layout with a variable number of entries

2010-10-15 Thread Ar Chron
Pale Horse wrote in post #951715: > Apologies for omitting the code you provided - I needed to reduce the > number of quoted lines. > > Thanks very much, I'll give that a try. I should've considered the > in_groups_of method before. > Bah, my last_col_pos calc is wrong... rather than group.length-

[Rails] Re: How old are you?

2010-10-12 Thread Ar Chron
David Kahn wrote in post #947370: > So if you dropped the box and they got out of order > That's why any "serious" programmer back in those days (not that I would know personally of anything like that) carried colored markers to mark stripes diagonally across the top of the batched deck...

[Rails] Re: What is the best way to learn rails 3.0 with no prior rails experience?

2010-10-07 Thread Ar Chron
egervari wrote: > What is the best way to learn rails 3.0 with no prior rails or ruby > experience? I'm just curious about it and want to get started. > Get ruby 1.9.2/rails 3/gems installed - tons of tutorials out there for a basic setup. Buy the Pickaxe book (is it still a pickaxe for Ruby 1.

[Rails] Re: Drop-down menu from a belongs_to association

2010-10-07 Thread Ar Chron
Leonel *-* wrote: > Now I have this at the form partial > Hmm... give this a whirl appointments controller: def new @appointment = Appointment.new @clients = Client.find(:all) respond_to do |format| format.html # new.html.erb format.xml { render :xml => @appointment } end end

[Rails] Re: where i should report an issue

2010-10-07 Thread Ar Chron
Amit Tomar wrote: > Hii all, > where should i report an issue means its mongrel issue where > could i report this Sheesh, do a little research... Google mongrel, and you'll find http://rubyforge.org/projects/mongrel/ among the links returned. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Good idea to send encrypted password with activation link

2010-10-06 Thread Ar Chron
Felix Samy wrote: > Is this good idea to send activation link with encrypted password Why would you want to send the encrypted password anywhere? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

[Rails] Re: Re: what is that get in routes?

2010-10-06 Thread Ar Chron
If you generated that controller then perhaps rails assumed a GET was the safest thing to default? -- 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 rubyonrail

[Rails] Re: NoMethodError

2010-10-01 Thread Ar Chron
> namespace :Geo do > desc 'Update cartcid with longitude and latitude information' > task :add_cartcid_coordinates => :environment do > include GeoKit::Geocoders > c = Cartcid.find_by_sql(["SELECT address FROM cartcid WHERE > ADDRESS IS NOT NULL"]) > begin >

[Rails] Re: NoMethodError

2010-10-01 Thread Ar Chron
You're re-using your geotable variable inappropriately... try: geotables = Geotable.find_by_sql(["SELECT * FROM geotable WHERE ADDRESS IS NOT NULL"]) begin geotables.each { |geotable| loc = MultiGeocoder.geocode(geotable.address) blah blah blah -- Posted via http://www.ruby-forum.com/

[Rails] Re: Seeking RoR Development Shop for TOP SECRET project

2010-10-01 Thread Ar Chron
No no, you've missed it... > We are looking for a team of 15 full-time RoR programmers ... ... > - Have a Seasoned Team of 25+ who have worked together for 3+ years Hmm, 15 developers. Add in 1 QA person for every 3 developers, and that gets us to 20. Add in an overbearing DBA to complain that

[Rails] Re: Railroad problem with :through?

2010-09-29 Thread Ar Chron
Sem Ptiri wrote: Is this a typo, or your problem source? > class Subscriber < ActiveRecord::Base > has_many :lists > has_many :lists, :through => :list_subscribers > end > class Subscriber < ActiveRecord::Base has_many :list_subscribers has_many :lists, :through => :list_subscribers end --

[Rails] Re: Newbe question

2010-09-28 Thread Ar Chron
I think one of your key design decisions up front is who defines the tags/keywords? If it is left up to the users to enter tags, then you might look into the has_many_polymorphs gem and the tagging facilities available there. This case makes it a tad more difficult to deal with searches, becaus

[Rails] Re: Uploading photos

2010-09-28 Thread Ar Chron
I would think it is much simpler... Be sure you have ImageMagick installed (or an alternative) Be sure your migration defined the logo_file_name, logo_content_type, logo_file_size in the jobs table. My example: class Stage < ActiveRecord::Base # cycling race stage # belongs to a race-year,

[Rails] Re: Uploading photos

2010-09-27 Thread Ar Chron
Piece of cake.. be sure to check out 'rails paperclip' via google. Tons of useful examples. -- 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...

[Rails] Re: design decision

2010-09-27 Thread Ar Chron
If I understand the requirement, then the creation of an e-mail is the business of the model. Controller should be deciding "After creation of model X, what view does the user see? To the index view, the show view of the model just created, or back to the view the user was at before creating th

[Rails] Re: problem with the "detail"-method

2010-09-24 Thread Ar Chron
Marnen Laibow-Koser wrote: > > Hast du ein URL? I can read German (though I've never used Rails 3)... > Hi Marnen, I was trying to get an idea of the lesson by browsing the "course contents" in this pdf: www.video2brain.com/de/pdf-toc-60.pdf -- Posted via http://www.ruby-forum.com/. -- Yo

[Rails] Re: How to call a method in a controller with link_to?

2010-09-24 Thread Ar Chron
routes.rb resources :messages do member do get :tweet end end should give you a tweet_message_path to use in a view like <%= link_to('Tweet This', tweet_message_path(message.id)) %> and direct the app to your tweet method in the messages_controller -- Posted via http://www.ruby-forum.

[Rails] Re: problem with the "detail"-method

2010-09-24 Thread Ar Chron
>From earlier in the post-stream: class FormController < ApplicationController def index @form = Form.find(:first) @form.update_attributes(params[:form]) @detail = @form.detail @detail.update_attributes(params[:detail]) end end >From your log: {"commit"=>"Speichern", "action

[Rails] Re: Re: Re: Re: problem with complex function to save in db

2010-09-24 Thread Ar Chron
Almog Friedman wrote: > I didn't quite understand why did you put > that: @faction = Faction.find(:last, :order => 'id') at the end of the > controller action. In the code I posted, there is no @faction object populated from the params, and standard routing after a create is to go to the show fo

[Rails] Re: Re: Re: problem with complex function to save in db

2010-09-23 Thread Ar Chron
Hmm... maybe you do need a table name involved: Controller: def create hash = params[:faction] hashnew = save_ids(hash, 'FactionContent') Faction.create(hashnew) @faction = Faction.find(:last, :order => 'id') end And that other routine: def save_ids(arguments, table) ret = Hash.new

[Rails] Re: Re: Re: problem with complex function to save in db

2010-09-23 Thread Ar Chron
Almog Friedman wrote: > heres the log hope it'll help: > Processing FactionsController#create (for 127.0.0.1 at 2010-09-23 21:46:39) [POST] Parameters: {"commit"=>"Create", "authenticity_token"=>"1f1aa67b947f0e23dc19aad8debc1e63b6df002c", "faction"=>{"name"=>"asdasd", "name_plural"=>"asdasd", "d

[Rails] Re: Confused with bcrypt and Authlogic

2010-09-23 Thread Ar Chron
CV wrote: > Well, I didn't realize that there was a lower-level part to the > library too! But unfortunately we're not there yet: > > ruby-1.9.2-p0 > BCrypt::Engine.hash_secret("test", > "Hki1ozSQrkmvGzddNJq") > BCrypt::Errors::InvalidSalt: invalid salt I wonder if Authlogic overrode any of the d

[Rails] Re: Re: problem with complex function to save in db

2010-09-23 Thread Ar Chron
Almog Friedman wrote: > sorry but I'm kinda new with rails, i don't know how to get a log of the > hash itself. > how do I do that? development.log should be in a folder like: C:\rails\appname\log\development.log or home\druid\rails\appname\log\development.log in a *nix envt. -- Posted via htt

[Rails] Re: Confused with bcrypt and Authlogic

2010-09-23 Thread Ar Chron
Should you be using something like: if BCrypt::Engine.hash_secret(password, u.salt) == u.crypted_password valid = true 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

[Rails] Re: Confused with bcrypt and Authlogic

2010-09-23 Thread Ar Chron
CV wrote: > ...but the result is "false". Do we need to work the salt in? And if > yes, how? Trying to pass it as a constructor argument or trying the > "salt" setter doesn't work. You're saving the crypted_password and the salt that was used to create it, so the validation of a newly submitted p

[Rails] Re: problem with the "detail"-method

2010-09-23 Thread Ar Chron
Sven Wildermann wrote: > You have a nil object when you didn't expect it! > You might have expected an instance of ActiveRecord::Base. > The error occured while evaluating nil.update_attributes" > Can you show the POST from your log file... I'd like to see what your params hash looks like. --

[Rails] Re: Re: Connecting several tables in single database

2010-09-23 Thread Ar Chron
You are probably getting an "undefined method 'cities' for #" error. Address each hierarchy level in turn... <% @names.each do |name| %> <% name.cities.each do |city| %> <%= city.local_area %> <% end %> <% end %> <% @names.each do |name| %> <% name.countries.each do |country| %> <%

[Rails] Re: problem with complex function to save in db

2010-09-23 Thread Ar Chron
TEREN wrote: > > this is my function: > def save_id(arguments, tables) > arguments_id = arguments > arguments.each_pair do |key, value| > pair = { :english => value} > tables["content"].new.save(pair) > content_id = tables["content"].find(:first, :order => "id > DESC").

[Rails] Re: Multipe Combo box Query System

2010-09-23 Thread Ar Chron
You should look into: http://stackoverflow.com/questions/575862/rjs-using-observe-field-on-select-tag for info on how to use observe_field in combination with a select. I just did a sursory review, and it looks like a decent solution guideline. -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: Connecting several tables in single database

2010-09-23 Thread Ar Chron
PalaniKannan K wrote: > *name model* > has_many :city, :foreign_key => "name_id" > has_many :country, :foreign_key => "name_id" > * has_many models should be pluralized class name < ActiveRecord::Base has_many :cities has_many :countries end -- Posted via http://www.ruby-forum.com/. -- Yo

[Rails] Re: problem with the "detail"-method

2010-09-23 Thread Ar Chron
Sven Wildermann wrote: > class FormController < ApplicationController > def index > @form = Form.find(:first) > @form.update_attributes(params[:form]) > > @detail = @form.detail > @detail.update_attributes(params[:detail]) > end > end > IIRC, given the code above as the main

[Rails] Re: Rails-2.3.8 routing question

2010-09-21 Thread Ar Chron
Look into the routing docs for :member and :collection options. http://rails.rubyonrails.org/classes/ActionController/Resources.html -- 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 th

[Rails] Re: routing ... Mapping... can only get to index

2010-09-20 Thread Ar Chron
Cameron Vessey wrote: > You don't get it. > Sorry dude, but you are the one who doesn't get it. Your posts 'smelled' a great deal like a total newbie post, and as such elicited a response directed at a total newbie. It may not have occurred to you that your spelling of user_loggin didn't str

[Rails] Re: Problem about "no action" error

2010-09-20 Thread Ar Chron
kun niu wrote: > Hi all, > I'm a ROR newbie. I'm writing ROR application on Ubuntu 10.04, ruby > 1.8.7-p249, rails 2.3.5, mongrel 1.1.5. I wrote a controller called > "admin". Okay, that is nice... > I also defined a function in the corresponding controller > called "show_admin". Not so nice..

[Rails] Re: Trying to look up comment through an ID, but failing

2010-09-17 Thread Ar Chron
Kelp Kelp wrote: > > comments_controller#new: > @comment_parent = Comment.find(params[:in_reply_to]) > Why not just: @comment = Comment.new @comment.parent_id = params[:in_reply_to] if params[:in_reply_to] > > <%= f.hidden_field :parent_id, :value => @comment_parent.id %>

[Rails] Re: Twitter Plugin

2010-09-15 Thread Ar Chron
muralidharan K wrote: > Hi All > > I did search twitter plugin. I did n't get it. Then you need to practice your Google-fu more Grasshopper... Google "rails twitter plugin" for tons of resources -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed

[Rails] Re: Re: Populate combo box from database without repeatness

2010-09-09 Thread Ar Chron
PalaniKannan K wrote: > But, I am unable to use params[:id] to get the selected value > from collection_select. how i can get selected value to params. > > I need the flow > collection_select (value selected) -> param[:id]-> find SQL row.. > The selected value is in params already, just not whe

[Rails] Re: Hello

2010-09-09 Thread Ar Chron
There are probably a bazillion tutorials out on the web (well, maybe only a million). Google is your friend in this regard. The forum members can't really recommend anything specific because we don't know even what your OS is, and the specific install instructions differ according to the OS. A

[Rails] Re: Will a Quad-core i5 processor significantly speed up development on Linux or Mac?

2010-09-09 Thread Ar Chron
My own $0.02... Buy the best machine you can afford to today, or wait. There will always be a better deal in a month, it's the nature of the beast. And price vs performance is always a subjective matter. The i5 will have a longer useful lifetime, but I don't know how often you change your rig

[Rails] Re: Expire cache in rake issue

2010-09-08 Thread Ar Chron
jazzy jazzy wrote: > Hi All, > I am trying to expire a fragment cache in rake. I know that the best > practice to expire the cache is in the Sweepers. But as I have to expire > the cache at the end of the month I was thinking on the lines of doing > it in a rake task. > I had tried this but it show

[Rails] Re: Layouts in Rails 3.0

2010-09-08 Thread Ar Chron
Jaap Haagmans wrote: > In my controller: > > class ApplicationController < ActionController::Base > protect_from_forgery > > layout 'application' > end > Yank the layout 'application' statement and you should be fine. My out-of-the-generator Rails 3 app honors the application.html.erb w

[Rails] Re: no output

2010-09-08 Thread Ar Chron
ishu wrote: > I am working on rails 9.10 n ruby 1.9 > I have used rspec in the application. > While using rake spec command, i am not getting any output. > Help me at the earliest. I assume you mean Ubuntu 9.10 as the OS, ruby 1.9.something, and an unknown version of Rails... not much help anyon

[Rails] Re: Populate combo box from database without repeatness

2010-09-08 Thread Ar Chron
a. Get your DB Access out of the views... b. Read The Fine Manual on collection_select c. Controller: @vendors = TableName.find(:all).uniq or some variant thereof With a lot of records, you might want to use a find_by_sql and let the DB do the work with a "SELECT DISTINCT..." d. View: <%= c

[Rails] Re: problem with passing local variables to a partial view

2010-09-08 Thread Ar Chron
Why the whole :fp inside the partial? Just use fp... -- 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 t

[Rails] Re: Expire_fragment in observer/model? Works fine in Sweepers.

2010-09-08 Thread Ar Chron
Steven Cummings wrote: > > Had this problem too and wrote up the solution the other night on my > blog. > > http://stevencummings.name/2010/09/07/expire_fragment-with-rake-and-as-a-model-only-observer Interesting solution... Related to model-based cache expiration, in one large-ish Rails proje

[Rails] Re: Re: Re: Re: Re: Re: problem when : ruby script/server

2010-09-07 Thread Ar Chron
radhames brito wrote: > the only thing a bit hard about it is editing the rc file, tell me what > linux you have and what shell i will see how i can guide you to install > RVM To create one in Ubuntu, just a simple sudo gedit .bashrc in a command window from your home folder will create one, re

[Rails] Re: Caching

2010-09-07 Thread Ar Chron
Ar Chron wrote: Er, ignore my math. 30 per page, edit/change 1, save rendering on 29, not 39... Doh! -- 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, sen

  1   2   3   4   5   6   >