[Rails] Extract all routes and test their views?

2010-09-17 Thread Zoran Szagaski
Hey, I'm trying to add some more tests to my application and was wondering what's the best way to test all my routes/views of my application. I'm using HAML which can lead to some typos since I'm new to it and of course the Ruby code itself in the views. How would you test the views? Does it

[Rails] Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Sudhir Vishwakarma
i am stuck somewhere with The Acrive record association . whenever i try to get the value from another table it gives me the foolowing error undefined method `journal_name' for nil:NilClass MY Controller def index @ledgers = Ledger.find(:all) @finaccounts = Finaccount.find(:all)

[Rails] Chat Application

2010-09-17 Thread krishnamoorthy m
Hi Pals, I am in need of finishing a chat Application in Rails3. What to do ?Any idea: Any plugins there?Kindly help me guyz. -- 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

[Rails] Rails base model

2010-09-17 Thread DanielMedia
I'm very new to Ruby and to Rails. I'm coming from PHP and CakePHP. I would like to create a base model from which all other models will inherit from. I have done this: class AppModel ActiveRecord::Base end and class Post AppModel end I'm getting the following error: Table

[Rails] error couchrest_model [not found]

2010-09-17 Thread Rune Skjoldborg Madsen
Hey all I've create a rails 3 project and added the following to the gem file: # Require Couchdb gem 'couchrest', '= 1.0.0.beta' gem 'couchrest_model' Everything installs when running bundle install But when I try to do this: rails generate model User --orm=couchrest_model I get this error:

[Rails] Re: Performing nested queries in rails

2010-09-17 Thread Veera Sundaravel
If possible try with :conditions parameter. T.Veeraa http://tinyurl.com/25vma7h -- 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

[Rails] Re: Chat Application

2010-09-17 Thread Veera Sundaravel
Hi Krish, You can find lot more jQuery plugin in online to do a simple chat application. For example: http://anantgarg.com/2009/05/13/gmail-facebook-style-jquery-chat/ Regards, T.Veeraa. http://tinyurl.com/25vma7h @veerasundaravel krishnamoorthy m wrote: Hi Pals, I am in need of

[Rails] Re: Rails base model

2010-09-17 Thread Veera Sundaravel
Hi Daniel, Go through this link http://stackoverflow.com/questions/937429/activerecordbase-without-table-rails Where in, answers section you can find an example related to your approach. -- Regards, T.Veerasundaravel. http://tinyurl.com/25vma7h @veerasundaravel DanielMedia wrote: I'm very

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Heinz Strunk
Apparently one or more of your ledgers doesn't have a journel? Try: td%=h ledger.journel.journal_name if ledger.journel %/td to see the ones that don't have journels. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Search inside files

2010-09-17 Thread Vincenzo Ruggiero
Hello all, Do you have more informations about developping a search functionnality to search inside PDF, Word, Excell, ... files ? I think I have to use acts_as_solr but I don't find any information about searching in documents. Thank you ! Vincenzo -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Chat Application

2010-09-17 Thread Krishh
Yeah thnx Veera. .but they are in need of some amount.. On Sep 17, 1:57 pm, Veera Sundaravel li...@ruby-forum.com wrote: Hi Krish, You can find lot more jQuery plugin in online to do a simple chat application. For example:http://anantgarg.com/2009/05/13/gmail-facebook-style-jquery-chat/

[Rails] Re: Extract all routes and test their views?

2010-09-17 Thread Heinz Strunk
I'm not sure how to get all routes (I guess you wanna test all routes from rake routes?) but route testing is quite easy. Should look somehow like this: test should route to post do assert_routing '/pages/1', { :controller = pages, :action = show, :id = 1 } end -- Posted via

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

2010-09-17 Thread Bigos
On Sep 9, 9:48 am, Colin Law clan...@googlemail.com wrote: On 9 September 2010 00:50, Bigos ruby.obj...@googlemail.com wrote: ... inpartialI had to do following: % def show_comments(post_id, kind=:children, fcomment=nil) I am sorry but defining a method in a view is horrible.  At the

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Sudhir Vishwakarma
Thanks For the Help Heinz Strunk. But i need To Know Is there anything with rails 2.3.5 because to check wheather i have made any mistake in my application i created a sample application , and again it was the same error i got . waiting for your reply and one more thing ..i am only a couple of

[Rails] Re: Search inside files

2010-09-17 Thread Veera Sundaravel
Vincenzo Ruggiero wrote: Hello all, Do you have more informations about developping a search functionnality to search inside PDF, Word, Excell, ... files ? I think I have to use acts_as_solr but I don't find any information about searching in documents. Thank you ! Vincenzo If

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Veera Sundaravel
If you are much interested in Rails Associations means, refer these URLs. http://guides.rubyonrails.org/association_basics.html http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html -- Regards, T.Veerasundaravel. http://tinyurl.com/25vma7h @veerasundaravel Sudhir

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Sudhir Vishwakarma
Sorry But I guess I have read all The Associations ..the only thing i want to know is there any problem with rails 2.3.5 because when i make the associations in 2.3.5 i get the same error undefined method `some method' for nil:NilClass Veera Sundaravel wrote: If you are much interested in

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Frederick Cheung
On Sep 17, 11:01 am, Sudhir Vishwakarma li...@ruby-forum.com wrote: Sorry But I guess I have read all The Associations ..the only thing i want to know is there any problem with rails 2.3.5 because when i make the associations in 2.3.5 i get the same error undefined method `some method' for

Re: [Rails] Rails base model

2010-09-17 Thread Jon Leighton
Hi there, On Thu, 2010-09-16 at 18:12 -0700, DanielMedia wrote: I'm very new to Ruby and to Rails. I'm coming from PHP and CakePHP. I would like to create a base model from which all other models will inherit from. I have done this: class AppModel ActiveRecord::Base end and

Re: [Rails] Extract all routes and test their views?

2010-09-17 Thread Jon Leighton
Hi Zoran, On Fri, 2010-09-17 at 09:28 +0200, Zoran Szagaski wrote: Hey, I'm trying to add some more tests to my application and was wondering what's the best way to test all my routes/views of my application. I'm using HAML which can lead to some typos since I'm new to it and of course the

Re: [Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Srikanth Shreenivas
On Fri, Sep 17, 2010 at 3:31 PM, Sudhir Vishwakarma li...@ruby-forum.comwrote: Sorry But I guess I have read all The Associations ..the only thing i want to know is there any problem with rails 2.3.5 because when i make the associations in 2.3.5 i get the same error undefined method `some

[Rails] Re: Rails base model

2010-09-17 Thread Frederick Cheung
On Sep 17, 2:12 am, DanielMedia hanzgro...@gmail.com wrote: I'm getting the following error: Table 'blog_development.app_models' doesn't exist My question is, how do I tell Rails not to look for a table named app_models AND am I even taking the right approach here? Is there a better way

[Rails] I create a new video website by rails

2010-09-17 Thread 新 高
domain:http://ichiba.cc It is interesting because its player. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Rails base model

2010-09-17 Thread MaD
sorry to say, but your short answer is wrong. class AppModel ActiveRecord::Base end Table 'blog_development.app_models' doesn't exist My question is, how do I tell Rails not to look for a table named app_models AND am I even taking the right approach here? Is there a better way to

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Heinz Strunk
I doubt there's a problem with Rails 2.3.5 Fire up the console and try following: ledger = Ledger.first ledger.journel = Journel.first ledger.journel.journal_name This should work and if so the ledgers you're calling in the view just doesn't have a journel. If not something's wrong with the

Re: [Rails] Re: Chat Application

2010-09-17 Thread shyam mohan
Hi ... try this ... http://rubypond.com/blog/make-your-own-im-bot-in-ruby-and-interface-it-with-your-rails-app Regards Shyam +91-971-618-9650 shyam.heroku.com On Fri, Sep 17, 2010 at 3:44 PM, MaD mayer.domi...@gmail.com wrote: you could checkout juggernaut. i just realized a chat

[Rails] ruby's oauth2 grant_type

2010-09-17 Thread Alexey Poimtsev
Hi, i started using oauth2 gem by intridea (http://github.com/intridea/oauth2) and don't know how to fix this problem. I have developed both client and server and on request for access_token i see no grant_type parameter. My code from client callback controller class CallbackController

[Rails] Deprecated error_messages, what to use now?

2010-09-17 Thread Heinz Strunk
Hey, as you all may know error_messages are deprecated: DEPRECATION WARNING: f.error_messages was removed from Rails and is now available as a plugin. Please install it with `rails plugin install git://github.com/rails/dynamic_form.git` Installing the plugin of course helps but I've been

Re: [Rails] Deprecated error_messages, what to use now?

2010-09-17 Thread Chris Mear
On 17 September 2010 11:54, Heinz Strunk li...@ruby-forum.com wrote: as you all may know error_messages are deprecated: DEPRECATION WARNING: f.error_messages was removed from Rails and is now available as a plugin. Please install it with `rails plugin install

[Rails] Re: Deprecated error_messages, what to use now?

2010-09-17 Thread Heinz Strunk
Alright, thanks! Will build my own helper method then. -- 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

[Rails] invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Amit Tomar
hi all, When Trying to upload 2GB of stream i got invalid content length error am running Apache as frontend server to mongrel and chrome as my browser. One more thing one i do it with mongrel alone am able to upload this 2 GB of stream ,cud anybody tell me whats the problem and how do i

[Rails] Key Value Json ActiveModel::Errors

2010-09-17 Thread Fabio Kreusch
Hi all, I'm using Rails 3.0, and I have a model which validates if the attribute :name is present. On my my views, I use Jquery to submit the form which creates the model. If the name is not present, Rails returns something like this Json: ['Name is a required value'] Is there a way to make it

[Rails] Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Frederick Cheung
On Sep 17, 1:22 pm, Amit Tomar li...@ruby-forum.com wrote: hi all,        When Trying to upload 2GB of stream i got invalid content length error am running Apache as frontend server to mongrel and chrome as my browser. One more thing one i do it with mongrel alone am able to upload this 2

[Rails] How to create a project with an older version of rails

2010-09-17 Thread Greg Ma
Hi, I have installed Rails 3 on my local machine. Let's say I wan't to create a new project but in version 2.3.5, can I do that? Greg -- 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] [JOBS] Sr. Technology Manager RoR $250k-$300k+ NYC Washington DC

2010-09-17 Thread Ruby Kate
Well funded internal startup of a major data rich content provider is seeking a seasoned technology leader intimately familiar with web based data rich platforms and the people and project management approaches that lead to a successful launch. The beta version of this platform has been so well

[Rails] Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Amit Tomar
Frederick Cheung wrote: On Sep 17, 1:22?pm, Amit Tomar li...@ruby-forum.com wrote: hi all, ? ? ? ?When Trying to upload 2GB of stream i got invalid content length error am running Apache as frontend server to mongrel and chrome as my browser. One more thing one i do it with mongrel alone am

Re: [Rails] How to create a project with an older version of rails

2010-09-17 Thread Jon Leighton
On Fri, 2010-09-17 at 14:48 +0200, Greg Ma wrote: Hi, I have installed Rails 3 on my local machine. Let's say I wan't to create a new project but in version 2.3.5, can I do that? Easiest way is probably to use an RVM gemset which just contains 2.3: http://rvm.beginrescueend.com/gemsets/basics/

Re: [Rails] How to create a project with an older version of rails

2010-09-17 Thread murali dhararao
Yes you can do that . Install rails version 2.3.5 by using command gem install rails -v=2.3.5 . And for creating a project rails _v_2.3.5Name of application . Use this command you will achive your result. On Fri, Sep 17, 2010 at 6:44 PM, Jon Leighton j...@jonathanleighton.comwrote: On Fri,

Re: [Rails] Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Walter Lee Davis
From a shell on the server, type httpd -v and press return. Walter On Sep 17, 2010, at 9:09 AM, Amit Tomar wrote: how do i find Apache version and am using Apache comes with instantrais 2.0 -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] [JOB] Software Development Manager

2010-09-17 Thread Matt
We are looking for a Software Development Manager for a great opportunity here in Austin. Salary range is 100 - 130k DOE. If you have Ruby on Rails Development experience, and have led a team of Engineers, here are the details: GENERAL As a Software Development Manager you will lead a fast

[Rails] Re: Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Amit Tomar
Walter Davis wrote: From a shell on the server, type httpd -v and press return. Walter Walter i am running apche server on two different machine ,on one machine i am using apache that comes with XAMPP and when i type command httpd -v ,i got Server version: Apache/2.2.11 (Win32) Server

Re: [Rails] Re: Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Walter Lee Davis
Compare the results of the command echo PATH on both terminals. Whenever you issue a command in a shell without using an absolute (root-relative) path to that command, like say, http instead of /usr/ local/bin/httpd, you are asking the shell to fill in the missing bits for you. The way

[Rails] Re: Re: Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Amit Tomar
and Walter what about my above problem invalid content length -- 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

Re: [Rails] Re: Re: Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Walter Lee Davis
Well, I thought that was explained earlier. You need to figure out what the server is running, and see if that is your problem. Sounds likely to me, but I'm not there, and I've never tried to run Apache on a Windows computer before. You might want to try a cheap and cheerful Unix hosting

[Rails] Re: Re: Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Amit Tomar
Thanks Walter for your help.. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: invalid content-Length ERROR while uploading 2 GB of stream

2010-09-17 Thread Amit Tomar
Thanks Fred -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Bundler for Rails 3 Engine

2010-09-17 Thread Joao Silva
I'm looking for the same! Is it possible? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group,

[Rails] Re: Bundler for Rails 3 Engine

2010-09-17 Thread Michael Schuerig
On Tuesday 11 May 2010, andyjeffries wrote: How do I configure a Rails-3 Engine so that the engine's Gemfile is integrated with the parent-Rails-app's bundle? You package your plugin as a gem, then add it as a dependency to your Rails app. Write up a yourplugin.gemspec and put

[Rails] Re: Execute System command asynchronously in Controller-Action

2010-09-17 Thread Roberto Decurnex Gorosito
Hi, Two things about your problem ... 1st - The behavior that you are describing should only apply to your dev environment since you should be able to set up your production server to manage more than a single request at time. Anyways, there's always a solution regardless of the environment

[Rails] Re: Documentation for active record validates helper

2010-09-17 Thread Daniel Lidström
On 16 Sep, 13:34, radhames brito rbri...@gmail.com wrote: validates triggers when validation accurds but it does not perform validation by it sellf you have to pass it the validation function validates  :to_many_drinks def to_many_drinks self.drinks 80 errors.add(:drinks, LOL) end this

Re: [Rails] Re: Documentation for active record validates helper

2010-09-17 Thread Greg Donald
On Fri, Sep 17, 2010 at 9:46 AM, Daniel Lidström dlidst...@gmail.com wrote: validates :name,  :presence = true,                    :length = { :maximum = 50 } The above validates the name attribute, makes sure it is present and of maximu 50 characters. Both presence and length were provided

[Rails] find instead of find_by_sql

2010-09-17 Thread PalaniKannan K
Dear all, I need to apply find instead of find_by_sql. Kindly suggest me. Because, params[gm] is not working with find_by_sql. Kindly justify whether my code below is in correct syntax... find_by_sql(SELECT column1 FROM table WHERE column2 = 'params[gm]' ORDER BY column1) -- With Regards

Re: [Rails] Re: Documentation for active record validates helper

2010-09-17 Thread radhames brito
sorry the code i posted was for rails 2.3.x -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

Re: [Rails] Re: Documentation for active record validates helper

2010-09-17 Thread radhames brito
watch this http://railscasts.com/episodes/211-validations-in-rails-3 On Fri, Sep 17, 2010 at 11:02 AM, radhames brito rbri...@gmail.com wrote: sorry the code i posted was for rails 2.3.x -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] option_groups_from_collection_for_select

2010-09-17 Thread Jim Burgess
Hi, in my development environment (Ruby 1.87, Rails 2.3.8) the following code works fine: %= select applicant, member_1, option_groups_from_collection_for_select(@topics, :members, :topic, :id, :name, @applicant.member_1), {:include_blank = true} % Producing: optgroup label=Clinical

[Rails] Re: bundler 1.0.0 RC makes me crazy (NOT solved)

2010-09-17 Thread Jacques Fuentes
Michael Hasenstein wrote: No, that wasn't the solution. Simply by ensuring passenger_ruby is correct (exists, is correct, is used by passenger) did not solve this problem for me - at least not on my laptop dev. system. The same setup works on my desktop dev. machine. Same passenger, same

[Rails] Re: Performing nested queries in rails

2010-09-17 Thread vishy
Restaurant.where(:cuisine = params[:cuisine]) will return all the Restaurants that that have the cuisine. However I am trying to filter the returned results from @restaurants = Restaurant.find(:all, :origin = @location, :within = 2) . Hence I am trying to apply the where condition on @restaurants,

[Rails] wysihat-engine and IE8

2010-09-17 Thread Walter Lee Davis
I am having serious problems with wysihat-engine 1.0.3 in a Rails 2.3.8 application when viewing on IE8. The first problem I encountered was that the toolbar didn't show at all. This was fixed with an Emulate IE7 meta tag, as documented on their wiki. But now whenever I click into the

Re: [Rails] find instead of find_by_sql

2010-09-17 Thread Rob Biedenharn
On Sep 17, 2010, at 11:01 AM, PalaniKannan K wrote: Dear all, I need to apply find instead of find_by_sql. Kindly suggest me. Because, params[gm] is not working with find_by_sql. Kindly justify whether my code below is in correct syntax... find_by_sql(SELECT column1 FROM table WHERE

Re: [Rails] find instead of find_by_sql

2010-09-17 Thread Walter Lee Davis
Try this: find_by_sql(SELECT column1 FROM table WHERE column2 = ? ORDER BY column1,params[:gm]) More here: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#method-c-find_by_sql Walter On Sep 17, 2010, at 11:01 AM, PalaniKannan K wrote: Dear all, I need to apply find instead of

Re: [Rails] find instead of find_by_sql

2010-09-17 Thread PalaniKannan K
Dear Rob, I got it... Thank you for help... But, I applied code of Rails 2 in Rails 3, It worked for me. It may lead any problem with Rails 2 code in future? -- With Regards Palani Kannan. K -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

Re: [Rails] find instead of find_by_sql

2010-09-17 Thread Rob Biedenharn
On Sep 17, 2010, at 11:42 AM, PalaniKannan K wrote: Dear Rob, I got it... Thank you for help... But, I applied code of Rails 2 in Rails 3, It worked for me. It may lead any problem with Rails 2 code in future? -- With Regards Palani Kannan. K It should work fine until Rails 3.1 (when

[Rails] Multiple Table Query

2010-09-17 Thread PalaniKannan K
Dear All, * Inputs:* Query 1 = column1.table1, Query2 = column2.table1 column3.table1 = foreign_key using this two queries and foreign key (column3.table1), I have to print a column4.table2 *condition:* where column3.table1 = column3.table2 I need to print *OUTPUT* column4.table2 Its simple

Re: [Rails] find instead of find_by_sql

2010-09-17 Thread PalaniKannan K
Dear Rob, Thank you for information. I will change all my Rails2 code to Rails3. It will be better in future. On 17 September 2010 17:49, Rob Biedenharn r...@agileconsultingllc.comwrote: On Sep 17, 2010, at 11:42 AM, PalaniKannan K wrote: Dear Rob, I got it... Thank you for help... But,

Re: [Rails] Re: Re: belongs_to two different people

2010-09-17 Thread Michael Pavling
On 15 September 2010 22:36, Brian Ablaza li...@ruby-forum.com wrote: No luck. The query ends with ORDER BY worker.name, manager.name, and as these are not columns in the Tasks table, it won't work. Sorry, my quick answer was hideously wrong to assume the joins that AR would create would be

[Rails] including a module in my model rails 3

2010-09-17 Thread Almog Friedman
i have a function that i wanna use in different models and i wanna do it DRY. so my best option as i see it is to include a module i made (that is in the lib/ directory) in the model. my code basicly looks something like this (for testing purpose, i didn't implement my function yet)

[Rails] Re: How to create a project with an older version of rails

2010-09-17 Thread E. Litwin
On Sep 17, 6:17 am, murali dhararao sumud...@gmail.com wrote: Yes you can do that . Install  rails version 2.3.5 by using command gem install rails -v=2.3.5 . And for creating a project  rails _v_2.3.5Name of application . Use this command you will achive your result. The command is: $ rails

[Rails] Weird caching error

2010-09-17 Thread badnaam
Using memcached/dalli on rails 2.3.5 I am trying to render to partials from the cache..and I see the following messages in the production log. [DEBUG 17-09-2010 10:03:06] Cache read: category_nav [DEBUG 17-09-2010 10:03:06] 127.0.0.1:11211 running memcached v1.4.2 [DEBUG 17-09-2010 10:03:06]

[Rails] Re: including a module in my model rails 3

2010-09-17 Thread Michael Schuerig
On Friday 17 September 2010, Almog Friedman wrote: i have a function that i wanna use in different models and i wanna do it DRY. so my best option as i see it is to include a module i made (that is in the lib/ directory) in the model. my code basicly looks something like this (for testing

[Rails] using OpenPGP gem and getting out of range error

2010-09-17 Thread lunaclaire
I've been handed someone else's code to debug, but am getting no further than he did... perhaps someone can help. We're using the OpenPGP gem (http://openpgp.rubyforge.org/) to PGP- encrypt an XML file for submission to a third-party for processing. The prob is that when encrypting, we get

Re: [Rails] Re: including a module in my model rails 3

2010-09-17 Thread Almog Friedman
the error i get is: NameError: uninitialized constant Test::ModelHelper On Fri, Sep 17, 2010 at 7:08 PM, Michael Schuerig mich...@schuerig.dewrote: On Friday 17 September 2010, Almog Friedman wrote: i have a function that i wanna use in different models and i wanna do it DRY. so my best

[Rails] Re: using OpenPGP gem and getting out of range error

2010-09-17 Thread lunaclaire
one more bit of info... if the data being encrypted is 250 chars or longer, the RangeError occurs; if it's 249 chars long, no error strange On Sep 17, 11:01 am, lunaclaire szager...@gmail.com wrote: I've been handed someone else's code to debug, but am getting no further than he did...

[Rails] Re: Rails base model

2010-09-17 Thread DanielMedia
Thanks for the help everyone. I really just wanted to have a base model and have the option of overriding methods for all models or adding functionality etc. I will try Fred and MaD's approach and see how that goes. I also realized that my initial idea to define a to_slug method in the AppModel is

[Rails] Plugins Restful_authentication can't install

2010-09-17 Thread Cameron Vessey
I'm a fairly new programmer, and I jump back and forth between PHP C# and Ruby. I'm trying to install a restful-authentication plugin but I can't get it to install into my ruby directory. I have looked it up and folowed the tutorials but no luck. I've tried C:\rubyscript/plugin source

[Rails] Re: Cache output issue

2010-09-17 Thread badnaam
You are right.. changing it to the following throws a nasty syntax error. %= Rails.cache.fetch all_catgory do % !-- generate html for categories -- % end % If I do % cache(:key = 'all_category') do % !-- generate html for categories -- %end% The it does work, BUT..somehow the page url is

[Rails] Re: Plugins Restful_authentication can't install

2010-09-17 Thread Cameron Vessey
ok i've gotten some succsess but I can't find plugin in now.. I had to go to the actual folder project was in for it to recognize scripting C:\Documents and Settings\Administrator\MyDocuments\NetBeansProjects\sms_web_app ruby script/plugin install

[Rails] Re: Plugins Restful_authentication can't install

2010-09-17 Thread Cameron Vessey
ok now installs a folder with no code in it with C:\Documents and Settings\Administrator\My Documents\NetBeansProjects\sms_web_appruby script/plugin install http://github.com/technoweenie/restful-authentication.git help!... lol -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: Plugins Restful_authentication can't install

2010-09-17 Thread Marnen Laibow-Koser
Cameron Vessey wrote: I'm a fairly new programmer, and I jump back and forth between PHP C# and Ruby. I'm trying to install a restful-authentication plugin Stop trying. restful-authentication is garbage due to its overreliance on unmaintainable generated code. Use Authlogic or something

[Rails] Re: Rails base model

2010-09-17 Thread Marnen Laibow-Koser
DanielMedia wrote: Thanks for the help everyone. I really just wanted to have a base model and have the option of overriding methods for all models or adding functionality etc. I will try Fred and MaD's approach and see how that goes. I also realized that my initial idea to define a to_slug

[Rails] Re: Plugins Restful_authentication can't install

2010-09-17 Thread Marnen Laibow-Koser
Cameron Vessey wrote: ok now installs a folder with no code in it with C:\Documents and Settings\Administrator\My Documents\NetBeansProjects\sms_web_appruby script/plugin install http://github.com/technoweenie/restful-authentication.git help!... lol Do you have a Git client

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

2010-09-17 Thread Kelp Kelp
I am trying to allow users to reply through comments by allowing users to click a reply link next to the parent comment. It will send in a parameter to the 'new' comment view, like so: | %= link_to Reply, new_comment_path(:in_reply_to = comment.id) % The form will use the :in_reply_to

[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] /div %= f.hidden_field :parent_id, :value = @comment_parent.id % and

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

2010-09-17 Thread radhames brito
place a hidden field in the form, add link_to_function and change the value of the hidden field with javascript. In the controller if the value of the hidden fill is empty the comment has no parent, else it does. example with jquery $(#the_form [type=hidden]).val(%=comment.id%) this will

[Rails] Understanding Rails Controllers/Models

2010-09-17 Thread nobosh
Hello, Rails newbie... trying to understand the right way to do things... In my app users can create a Book ( I have that working) What I want to happen is when a user creates a book, a record is added to the BookCharacters Table, something like (id, book.id, user.id,

[Rails] Re: Understanding Rails Controllers/Models

2010-09-17 Thread nobosh
Forgot to add. I'm using Rails 3. thxs On Sep 17, 2:26 pm, nobosh bhellm...@gmail.com wrote: Hello, Rails newbie... trying to understand the right way to do things... In my app users can create a Book ( I have that working) What I want to happen is when a user creates a book, a record is

[Rails] uninitialized constant ApplicationController::Authentication

2010-09-17 Thread paul
I don't know what happen when i suite with http://railscasts.com/episodes/188-declarative-authorization the error message happen when i have typed http://localhost:3000 -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] [JOBS] Columbus, OH

2010-09-17 Thread Jake
Solid opportunity local to Columbus, OH for about 3 months worth of fulltime, on-site project work. Interactive agency creating RoR web apps for their clients. Established group, dynamic individuals, interesting client projects, long-term potential -- just need some extra bandwith as we grow.

[Rails] Re: Cache output issue

2010-09-17 Thread Frederick Cheung
On Sep 17, 8:09 pm, badnaam asitkmis...@gmail.com wrote: The it does work, BUT..somehow the page url is prepended to the cache key so essentially this fragment which is same across the app, misses for every new page load. cache fragments are keyed like that by default - you can override

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

2010-09-17 Thread Kelp Kelp
Nice, is there a way that I can save the particular page from which the user is replying to, so I can redirect him there afterwards? In my show controller for my comments, I have this: @commentable = find_commentable where commentable can be article, profile, etc. Would I do the exact same

[Rails] Re: Roles that are UserProject Based

2010-09-17 Thread nobosh
Continuing along this thread... I'm interested in creating a SCOPE in the project model (project.rb) that returns all the project's members (bassed on the permissions table users role tables. Desired output: user.name, role.name Here's my scope in the model, which isn't returning the desired

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

2010-09-17 Thread radhames brito
just put redirect_to :back at the end of the create -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Roles that are UserProject Based

2010-09-17 Thread Marnen Laibow-Koser
nobosh wrote: Continuing along this thread... I'm interested in creating a SCOPE in the project model (project.rb) that returns all the project's members (bassed on the permissions table users role tables. Desired output: user.name, role.name Here's my scope in the model, which isn't

Re: [Rails] acts_as_solr plugin fate?

2010-09-17 Thread Hassan Schroeder
On Thu, Sep 16, 2010 at 12:20 PM, Paul p...@nines.org wrote: I suggest rsolr, since it is actively being developed (the Rails 3 version is in beta, but you can get it with --pre) Thanks for the recommendation. I'm still interested in knowing if anyone has a fork of the last release of

Re: [Rails] acts_as_solr plugin fate?

2010-09-17 Thread Walter Lee Davis
It's on github -- http://github.com/railsfreaks/acts_as_solr Walter On Sep 17, 2010, at 7:29 PM, Hassan Schroeder wrote: On Thu, Sep 16, 2010 at 12:20 PM, Paul p...@nines.org wrote: I suggest rsolr, since it is actively being developed (the Rails 3 version is in beta, but you can get it with

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

2010-09-17 Thread radhames brito
oh , i forgot you are doing polymorphic associations sorry, redirect_to polymorphic_path(@commentable) remember to catch @commentable with the find_commentable method you can find it iterating the params hash or user a context_Type in the route , i like that last one more. -- You received

[Rails] pagination and caching

2010-09-17 Thread badnaam
What's the best way to cache a paginated result set with rails and memcached. For example #posts controller def index @posts = Rails.cache.fetch('all_posts') do Post.paginate(:conditions = ['xx = ?', yy], :include = [:author], :page = params[:page], :order = 'created_at D.ESC')

Re: [Rails] acts_as_solr plugin fate?

2010-09-17 Thread Hassan Schroeder
On Fri, Sep 17, 2010 at 4:35 PM, Walter Lee Davis wa...@wdstudio.com wrote: It's on github -- http://github.com/railsfreaks/acts_as_solr I had found an online reference to the latest being on the railsfreaks site, and that appears to be the case because what we have is later than the one on

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

2010-09-17 Thread Kelp Kelp
radhames brito wrote: oh , i forgot you are doing polymorphic associations sorry, redirect_to polymorphic_path(@commentable) remember to catch @commentable with the find_commentable method you can find it iterating the params hash or user a context_Type in the route , i like that

[Rails] Re: Roles that are UserProject Based

2010-09-17 Thread nobosh
Alright Marnen, I think I'm getting it... I was able to get the team members by using the following in the projects controller: @teammembers = @project.users That gives me the users, but it doesn't provide the user's roles. I tried including/joining roles to the code above but that errored. Any

[Rails] Re: Roles that are UserProject Based

2010-09-17 Thread nobosh
All, I got this working, but would love to know if this is the way to do it RIGHT with Rails 3? @teammembers = @project.users.joins(:permissions = :role).select(roles.name) thank you! On Sep 17, 5:14 pm, nobosh bhellm...@gmail.com wrote: Alright Marnen, I think I'm getting it... I was able to

  1   2   >