[Rails] Re: For GIS applications

2009-08-02 Thread Sijo Kg
Hi Yes I want to draw maps, dealing with geocoded data, As exacltly according to the latlong information have to draw routes on map etc So could you please suggest a good gem and also the other helper urls if any Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~

[Rails] Re: Trouble understanding Routes

2009-07-31 Thread Sijo Kg
Hi brianp Your default routes should have the least priority Means map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' These should be at the very bottom of routes.rb Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~

[Rails] For GIS applications

2009-07-30 Thread Sijo Kg
Hi Could anybody please which is the most widely used gem for GIS applications I came across http://ym4r.rubyforge.org/ym4r-doc/ But seen it has not been updated since 2006 Thanks in adavnce Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~--

[Rails] Re: A newbie question

2009-07-30 Thread Sijo Kg
And one more thing. Your intended action is not index but new. Change action name to new and view file to new.html.erb Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: attachment_fu + :path_prefix

2009-07-30 Thread Sijo Kg
Give :storage => :file_system, :path_prefix => "public/user_#{current_user.id}" Sijo -- 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 po

[Rails] >= option in config.gem

2009-07-30 Thread Sijo Kg
Hi config.gem 'gemname', :version => '>= 1.2.1' Could anybody please tell what this actually means? Suppose I have in my machine version 1.2.1 and 1.2.2 of the gem What expected is it uses 1.2.1 But what happened is it used 1.2.2 version Is this the default behavoiur or something wrong T

[Rails] Re: attachment_fu + :path_prefix

2009-07-30 Thread Sijo Kg
:path_prefix => "public/#{current_user.id}" -- 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-tal

[Rails] Re: attachment_fu + :path_prefix

2009-07-30 Thread Sijo Kg
> 'public/uploads' i want a dyname path for e.g :path_prefix => 'public/#{ > current_user.id}', Have you tried this like :path_prefix => "public/#{> current_user.id}" Instead of single quotes use double quotes Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~

[Rails] Re: download file located outside rails aaplication folder

2009-07-29 Thread Sijo Kg
http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000421 Sijo -- 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

[Rails] Re: Functional Test Failing

2009-07-29 Thread Sijo Kg
Hi To get a good understanding read this. I think you are totally confused http://guides.rubyonrails.org/testing.html Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

[Rails] Re: Asociation problems

2009-07-29 Thread Sijo Kg
Hi This be approached in railsway You have post has_many comments and comment belong to post ? So can create two controllers Posts controller and Comments controller And in app/controllers/posts_controller.rb add def show @post = Post.find(params[:id]) @comment = @post.comments.new

[Rails] Re: Functional Test Failing

2009-07-29 Thread Sijo Kg
> Since the other functional test works Hi Is all your other tests work? If not please check each of following in 1.2.6 the test inherits from < Test::Unit::TestCase and in case of 2.x it from ActionController::TestCase In test/test_helper.rb search fixtures :all #This loads all fixtur

[Rails] GPS Tracking

2009-07-29 Thread Sijo Kg
Hi Is there any equivalent application in Rails like this http://track.opengts.org/track/Track?page=login This is in Java Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because yo

[Rails] Re: Asociation problems

2009-07-29 Thread Sijo Kg
Hi > class Comment < ActiveRecord::Base > belongs_to :post > end This expects post_id column in comments table. Is it there? Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

[Rails] Re: background process with ruby on rails

2009-07-29 Thread Sijo Kg
Hi Check this http://github.com/tra/spawn/tree/master Sijo -- 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 ema

[Rails] Re: Use of Ruby Gem and Plugin

2009-07-29 Thread Sijo Kg
Hi I shall share what I know Anyone please correct if I am wrong I think when a plugin stabilizes it goes to form gem .In case of plugin the code is with your railsProject So you dont need to install it on server again.And one thing it has to be loaded when you start the project So that much m

[Rails] Re: Functional Test Failing

2009-07-29 Thread Sijo Kg
Hi R u testing test_should_show_new (assume to test new action) or test_should_show_index (test index action?) ? And also you have to populate testdb using fixtures or can use factories Have you edited fixtures/stories.yml and enter data to it? After setting this just as a test, try the tes

[Rails] Re: RJS-Template and link_to_remote

2009-07-28 Thread Sijo Kg
Getting no error 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@googlegr

[Rails] Re: Number of scaffolds (Controllers)

2009-07-24 Thread Sijo Kg
And you can use :only and :except options to generate only the required routes ex. map.resources :users, :only => [:index, :show] map.resources :users, :only => [:update] Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this m

[Rails] Re: problem using rjs, please help

2009-07-23 Thread Sijo Kg
Hi change > <%= link_to_remote("hello", :update => "rjs", :url => {:action => > "hello_dude"}) %> to <%= link_to_remote("hello", :url => {:action =>> "hello_dude"}) %> Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received t

[Rails] Re: Help For Testing ruby on rails?

2009-07-22 Thread Sijo Kg
> I need to ask one thing > how to add data to database and check > Hi You can use fixtures or the better Factories for this Read this http://thoughtbot.com/projects/factory_girl Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] Re: Rails nested resource issue

2009-07-22 Thread Sijo Kg
Hi I think you can do do like <% form_for @household, :url => grant_application_household_path(@grant_application) do |f| %> OR <% form_for [...@grant_application, :household] do |f| %> >undefined method 'grant_households_path' for #http://www.ruby-forum.com/. --~--~-~--~---

[Rails] Re: Help For Testing ruby on rails?

2009-07-22 Thread Sijo Kg
To start with read http://guides.rubyonrails.org/testing.html Sijo -- 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

[Rails] Re: my first app with RoR problem.

2009-07-20 Thread Sijo Kg
Or if you are using mysql/postgresql/or what ever db edit config/database.yml and setup things there You can also do like when creating a project like rails project_name -d mysql and if its postgresql rails project_name -d postgresql Sijo -- Posted via http://www.ruby-forum.com/. --~--~

[Rails] Re: Is there anyway to get method name in view ?

2009-07-20 Thread Sijo Kg
action name params[:action] similarly controler name params[:controller] Sijo -- 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: Equipment_URL Failed to Generate (new_equipment_path)

2009-07-20 Thread Sijo Kg
Hi You can do like following edit config/initializers/inflections.rb ActiveSupport::Inflector.inflections do |inflect| inflect.irregular 'equipment', 'equipments' end Now as I said before ./script/generate scaffold Equipment That the solution. This is because rails takes plural

[Rails] Re: render :file in another window

2009-07-20 Thread Sijo Kg
format.pdf {send_data(@asset, :filename => @asset.data.path, :type =>'application/pdf',:disposition => 'inline') } Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

[Rails] Re: how to search for a speciel file extension

2009-07-20 Thread Sijo Kg
Hi You will get filenames with extension .ppt from a folder and its subfolders like files = [] Dir.glob('**/*').each do | file | files << file.downcase if file.downcase =~ /([^\s]+(?=\.(ppt))\.\2)/ end Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~---

[Rails] Re: admin rounting

2009-07-20 Thread Sijo Kg
You can take a look at namespace Just for an example map.namespace(:admin) do |admin| admin.resources :accounts end Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[Rails] Re: Intermittent routing problem

2009-07-20 Thread Sijo Kg
How did u create the controller employees and/or model employee? -- 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 ema

[Rails] Re: Equipment_URL Failed to Generate (new_equipment_path)

2009-07-19 Thread Sijo Kg
I think you can easily create all this with ./script/generate scaffold Equipment Is equipment a resource ?And also note after this the controller name.It is plural Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] Re: how to get "www.site.com/user1" address

2009-07-17 Thread Sijo Kg
Hi >I can have a page > for individual entry in the database. Did not understand that I think you better to start with an example ./script/generate scaffold User name:string Then watch what happens in config/routes.rb app/models app/views app/controllers > Now I also have a faint clue t

[Rails] Re: Find_all_by and find(:all) to only select certain values for a selection box

2009-07-17 Thread Sijo Kg
> because I only want to > see the foles whose mandant_id is the same like the mandant_id in > invoice. Hi File.find(:all,:conditions => {:mandant_id => Invoice.mandant_id}) Thinking that Invoice.mandant_id is an array Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~--

[Rails] Re: instance variable life span in controller

2009-07-16 Thread Sijo Kg
Sorry def get_title @title = first_app_setting.title end Sijo -- 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 grou

[Rails] Re: instance variable life span in controller

2009-07-16 Thread Sijo Kg
You can do like def get_title @title = @first_setting.title end - def first_app_setting @first_setting ||= AppSetting.first end Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscrib

[Rails] Re: How to make something like IN (1,3,4) in the :conditions

2009-07-16 Thread Sijo Kg
named_scope :unarchive, lambda { |project_identifier| { :conditions => ['id in (?,?,?)',3,4,5], } } Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails

[Rails] Re: error while testing validatesformatof

2009-07-14 Thread Sijo Kg
Hi I got an answer to use this /(?>\w+\s*(?=,))+/ (http://www.ruby-forum.com/topic/191457#834715) But this in the unless case dont know how to negate this? Thanks Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this messag

[Rails] error while testing validatesformatof

2009-07-14 Thread Sijo Kg
Hi I have model Role as validates_presence_of :name validates_presence_of :description validates_format_of :name, :with => /[,]/ And the test to check format as setup do @role = Factory(:role) #gives :name=>'role1' description => 'testdescript' end should "validate format of

[Rails] Re: ActiveRecord, PostgreSQL question

2009-07-10 Thread Sijo Kg
Hi Can you try like The following can be moved to lib module ActiveRecord class Base def self.to_csv(sql_statement) self.connection.instance_variable_get(:@connection).exec("copy (#{sql_statement}) TO STDOUT WITH CSV") csv = [] while (line = pg_conn.getline) != "\\."

[Rails] Re: ./script/about with ruby 1.9.1

2009-07-10 Thread Sijo Kg
Hi Thanks for your it worked Now to test the performance difference between Ruby1.9.1 and ruby 1.8.6 with rails 2.3.2 what I did is Created a rails projects using 1.9.1 and 1.8.6 Then created a model and migrated it to the db using 1.8.6 Ruby+rails Now from the project created using the 1.

[Rails] Re: replace the default home page

2009-07-10 Thread Sijo Kg
Delete or rename public/index.html ? Sijo -- 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

[Rails] ./script/about with ruby 1.9.1

2009-07-10 Thread Sijo Kg
Hi In my machine there is Ruby1.8.6 ,1.9.1 and rails 2.3.2 And I created a new project using Ruby1.9.1 and rails 2.3.2 But when did ./script/about it shows Ruby version 1.8.6 (i386-linux) RubyGems version 1.3.1 Why this happens Thanks in advance Sijo -- Posted via http:

[Rails] Re: Render a whole HTML page after an Ajax request: possible

2009-07-10 Thread Sijo Kg
> Question: Is it possible to > - somehow render a whole HTML page (not only return a part of the page), render :update do |page| page.redirect_to :action => 'name' end Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this mes

[Rails] An implementation question

2009-07-10 Thread Sijo Kg
Hi This is an implementation question. I have various reports to be generated in my application like PDF reports, Excel reports etc So I tried like a main class Application report and all the other report types its sub classes For example TicketExcelreport < ApplicationReport MyPdfreport < App

[Rails] Re: ActiveRecord HABTM finds with "AND"

2009-07-07 Thread Sijo Kg
Hi arr = [] Feature.find(:all,:conditions => ['name in (?,?,?,?,?,?)','Wheelchair Access','Playground','Sandbark','Library','Computer Lab','Testing Center']).each {|f| arr = arr && f.schools} Now arr have the required value.Is that you want? Sijo -- Posted via http://www.ruby-forum.com/.

[Rails] Re: ActiveRecord HABTM finds with "AND"

2009-07-07 Thread Sijo Kg
Hi Try this Feature.find(:all,:conditions => ['name in (?,?,?,?,?,?)','Wheelchair Access','Playground','Sandbark','Library','Computer Lab','Testing Center']).each {|f| arr = arr && f.schools} Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~-

[Rails] Re: transaction in controller

2009-07-07 Thread Sijo Kg
> ActiveRecord::Base.transaction as the full name indicates is is not > available in ApplicationController . Did not get the above statement..Anyway you can do like def controller_action begin ActiveRecord::Base.transaction do -your all transactions here end rescue ActiveRecord::Ac

[Rails] Re: conentent management system in ROR

2009-07-07 Thread Sijo Kg
Hi Check this http://www.opensourcerails.com/projects?q=cms&x=0&y=0 Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this gro

[Rails] Re: Testing has_many

2009-07-06 Thread Sijo Kg
Rails functionality is well tested. But if you want to test I shal explain based on thoughtbot shoulda which I am using There are several macros given by shoulda In your case in test/unit/album_test.rb you can write should_have_many :photos In test/unit/photo_test.rb should_belong_to :albu

[Rails] Re: Beginner needs help

2009-07-02 Thread Sijo Kg
> > class AuthorTest < Test::Unit::Testcase change the above to class AuthorTest < ActiveSupport::TestCase -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails

[Rails] Re: Beginner needs help

2009-07-02 Thread Sijo Kg
> > class AuthorTest < Test::Unit::Testcase change the above to class AuthorTest < ActiveSupport::TestCase Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on

[Rails] Re: config.load_paths

2009-07-01 Thread Sijo Kg
Hi For more clarification, what I am asking is creating subdiretories under app/models and load_them using config.load_paths .. Is this creates any performance issue? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] config.load_paths

2009-07-01 Thread Sijo Kg
Hi As a part of rearranging the code I put my reports in the folder app/models/reports and loaded that using config.load_paths Is there any performance issue in doing this? Is this the right approach? or I have to put all the files in reports to app/models so to avoid config.load_paths #{folder

[Rails] Re: :select

2009-06-24 Thread Sijo Kg
Hi Thanks for the reply I did it like arr = Person.find(:all,:select => "first_name,first_name||last_name as full_name") May I ask one more question related to this ? Here in arr for each element i get the methods like first_name first_name= first_name? But I can't see any such like f

[Rails] Re: :select

2009-06-24 Thread Sijo Kg
But when I do that I get error INT: No operator matches the given name and argument type(s). You might need to add explicit type casts. : SELECT first_name, first_name+last_name as full_name FROM "people" -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--

[Rails] :select

2009-06-23 Thread Sijo Kg
Hi This is just an example .I have a model Person with fields first_name, last_name And after entering some records to the people table I tried the sql Person.find(:all,:select => "first_name,#{first_name+last_name} as full_name") But this is not working Could anybody please tell how can

[Rails] Re: opening old project

2009-06-22 Thread Sijo Kg
to start the old project as it is in your system you have to install rails 1.2.3 So do this gem install rails -v=1.2.3 Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: pdf generation

2009-06-21 Thread Sijo Kg
And continuing this thread after more than a year Is there any new PDF generator other than the above and more powerful, in ROR world now? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

[Rails] Re: display category name in url

2009-06-19 Thread Sijo Kg
map.computer_components 'computer_components',:controller => "categories",:action => "your_action_name' Now helper will be computer_components_url Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Re: Case Insensitive in Rails + Urgently Need

2009-06-19 Thread Sijo Kg
Area.find :all :conditions => ['lower(name) like (?)', area_name.down_case] -- 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: Case Insensitive in Rails + Urgently Need

2009-06-19 Thread Sijo Kg
O sorry here here you have to get the db records to be case insensitive If Area is just an array (Not clear) then can do Area.include?('whatEverName'.downacase) If its a model name its field Area.find(:all).collect {|a| a.name.downcase}.include?('whatEverName'.downacase) Sijo -- Posted via

[Rails] Re: Case Insensitive in Rails + Urgently Need

2009-06-19 Thread Sijo Kg
Area.exists?(:name => 'whatEverName'.downcase) -- 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: installing ruby 1.9.1 with ruby 1.8.6 on same Linux mach

2009-06-18 Thread Sijo Kg
Hi Thanks for the reply.I am able to install ruby 1.9.1 on another path. What I need is install a new instance of rails 2.3.2 using the ruby 1.9.1. So that I can work with my old projects on Ruby 1.8.6+rails2.3.2 without conflicting the new Ruby 1.9.1+Rails 2.3.2 setup. I tried it this way:

[Rails] installing ruby 1.9.1 with ruby 1.8.6 on same Linux machine

2009-06-17 Thread Sijo Kg
Hi I would like to install ruby1.9.1 with rails 2.3.2. I am currently using rails 2.2.2 and (also rails 2.3.2 is there in the system) with ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-linux] Could anybody please suggest a way to do this? My linux distro is fedora Thanks in advance Sijo -- Po

[Rails] Re: How to improve a plugin?

2009-06-16 Thread Sijo Kg
Then in any other place in your code you can call like m = MyClass.new m.first_def Again this is just an example.Please refer the above link from MaurĂ­cio Linhares post for more details Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] Re: How to improve a plugin?

2009-06-16 Thread Sijo Kg
For example if you have the class MyClass in the existing plugin and if you extend and create another plugin Then in the main library file you can do like MyClass.class_eval do def first_def end etc. This is only an example Like this you can do -- Posted via http://www.ruby-forum.c

[Rails] Re: How to improve a plugin?

2009-06-16 Thread Sijo Kg
What about extending the existing plugin without modifying ? -- 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

[Rails] Re: controller subfolders and routing

2009-06-15 Thread Sijo Kg
Another thing to add to this is Now in the model Admin::Link < ActiveRecord::Base have to say like set_table_name :admin_links Then we can access it like Admin::Link.find(:all) etc Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] Re: controller subfolders and routing

2009-06-15 Thread Sijo Kg
And if model is also namespaced the table will be admin_links When do ./script/generate scaffold Admin::Link happens this Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

[Rails] Re: controller subfolders and routing

2009-06-15 Thread Sijo Kg
Hi zambezi When create a controller do like ./script/generate controller Admin::Links Note : plural for controller If you are scaffolding it will be ./script/generate scaffold Admin::Link Note: It is singular And if generate model then ./script/generate model Admin::Link Note: Here

[Rails] Re: How to install Rails 1.1.6

2009-06-15 Thread Sijo Kg
gem install rails -v=1.1.6 Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegr

[Rails] Re: controller subfolders and routing

2009-06-14 Thread Sijo Kg
This can be done like ./script/generate controller Admin::Products and the rest as Nicholas Henry ponted Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rail

[Rails] Re: NoMethodError: undefined method `password_reset_instruct

2009-06-14 Thread Sijo Kg
> NoMethodError: undefined method `password_reset_instructions' for > UserNotifier:Class Hi can you post the code from where you are trying to call password_reset_instructions def? Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You recei

[Rails] Re: The error occurred while evaluating nil.to_sym

2009-06-14 Thread Sijo Kg
> 5. run script/generate scaffold release_notes title:string > version:string content:text Try like ./script/generate scaffold ReleaseNote title:string version:string content:text -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received thi

[Rails] Re: scaffold.. random error

2009-06-09 Thread Sijo Kg
> script/generate scaffold file name:string description:text > file_url:string online_status:boolean position:integer Change the name from file to some other It is reserved Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this

[Rails] Re: NameError what is it?

2009-06-08 Thread Sijo Kg
Just do ./script/generate scaffold ProcessJob from project root directory and watch what the names of model, controller etc and compare Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] Re: Remove special characters from sentence

2009-06-08 Thread Sijo Kg
(teststring.gsub(/[^a-zA-Z 0-9]/, "")).gsub(/\s/,'-') Sijo -- 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 t

[Rails] Re: Access values with has_and_belongs_to_many assocciation

2009-06-03 Thread Sijo Kg
To get all the products titles of my_author you can do like my_author.products.map(&:title) Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" grou

[Rails] Re: fields dont display on browser

2009-06-03 Thread Sijo Kg
http://www.tutorialspoint.com/ruby-on-rails/ This is good for beginners (Rails 2.1) There are so many others available on net Also try to get books 1.Agile web development with Rails 2.Beginning RubyOnRails (wrox publications) Sijo -- Posted via http://www.ruby-forum.com/. --~--~---

[Rails] Re: valdate_presnce_of email, :if => :validate_id + Factory

2009-06-01 Thread Sijo Kg
Mukund wrote: > Move that to a module and include it as a mixin in your model? Did not understand this.Could you please elaborate? Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails] valdate_presnce_of email, :if => :validate_id + Factory girl

2009-06-01 Thread Sijo Kg
Hi In the model I have User attr_accessor :validate_email_id validates_presence_of :email ,:if => :validate_email_id Could anybody please tell me how can I define a Factory for the above? Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~

[Rails] Re: modifing db

2009-05-21 Thread Sijo Kg
> Does the id need to be the "primary key"? You can set your own primary key like def self.up create_table :table_name, :primary_key => :primary_key_field_name, do |t| t.integer :primary_key_field_name - end Sijo -- Posted via http://www.ruby-forum.com/. --~--~---

[Rails] Re: xlsuite

2009-05-18 Thread Sijo Kg
Hi Now its working .What I did is rake gems:install and also comment config.gem "actionwebservice",:version => "= 1.2.6", :lib => "action_web_service" in environment.rb Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received t

[Rails] xlsuite

2009-05-17 Thread Sijo Kg
Hi I have seen this http://github.com/xlsuite/xlsuite/blob/aa274f71038f330b4cbd58a82f68a427c67ab38c/INSTALL and downloaded it And according to instruction when run rake db:create db:structure:load db:bootstrap Getting error rake aborted! can't activate actionpack (= 1.13.6, runtime), alrea

[Rails] capistrano-ext

2009-05-14 Thread Sijo Kg
Hi In my application config/deploy.rb I have set :stages, %w(dev testing) set :default_stage, "dev" require 'capistrano/ext/multistage' - -etc after "deploy", "deploy:migrate" Now in config/deply/dev.rb role :app, "192.168.1.13" role :db, "192.168.1.13", :primary => true And a

[Rails] Re: compare this sql query and corresponding ruby code

2009-05-13 Thread Sijo Kg
Hi Thanks for the reply.This working ut another question how can we specify :conditions with update_all Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Ra

[Rails] Re: compare this sql query and corresponding ruby code

2009-05-13 Thread Sijo Kg
Hi I tried like Activity.update_all("name='hi'", :conditions => ["ticket_id =?",1]) But getting error ActiveRecord::StatementInvalid: RuntimeError: ERROR C42703 Mcolumn activities.conditions does not existP42 Fparse_func.c L1104 Runknown_attribute: UPDATE "activities" SET nam

[Rails] compare this sql query and corresponding ruby code

2009-05-13 Thread Sijo Kg
Hi Suppose I have a two models Ticket and Activity Ticket has_many activities Activity belongs_to Ticket Now suppose if the Activity has field name Now for a Ticket with id=1 say there are 10 activities So to update name of all activities I can directly wite the sql statement update act

[Rails] Re: invoke a controller def from view without clicking any l

2009-05-11 Thread Sijo Kg
Hi In my partial I tried like But this onload not working Since I tried with an alert first Could you please tell how can I do this? Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribe

[Rails] invoke a controller def from view without clicking any link

2009-05-11 Thread Sijo Kg
Hi I have a controller def like def graph_render get_flash_chat_objects respond_to do |format| format.js do render :update do |page| page[:graph_div].replace_html :partial => "summary_graph" end end end end So clearly this just

[Rails] Re: accessing dll files from rails application

2009-05-08 Thread Sijo Kg
Hi Thanks for the alternative approcah But I would like to know how can I access a dll from rails?(Suppose from server side) Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

[Rails] accessing dll files from rails application

2009-05-08 Thread Sijo Kg
Hi Could anybody please suggest ways to access dll files from a rails application? Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails

[Rails] link_to_remote with Modalbox.show

2009-05-05 Thread Sijo Kg
Hi In helper I have change_email_link html = [] html << change_email_js(:email => @email) html << %{ edit } html.join end Now def change_email_js(options ={}) %{ popup_email = function() { Modalbox.show('#{ %{
etc.. #{li

[Rails] Re: will_paginate urls and AJAX calls

2009-04-29 Thread Sijo Kg
Hi Can you try like http://www.ruby-forum.com/topic/134632#726021 Sijo -- 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 grou

[Rails] static variables

2009-04-24 Thread Sijo Kg
Hi In controller I have def role_wise_summary_graph_render @graph1 = open_flash_chart_object(300,200, "#{summary_graph_path(:role_name => 'Role1')}", true) @graph2 = open_flash_chart_object(300,200, "#{summary_graph_path(:role_name => 'Role2')}", true) respond_to do |format| ---

[Rails] Re: dealing with complex query by find_by_sql

2009-04-23 Thread Sijo Kg
Hi I didnot get an answer to this yet Sijo -- 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-

[Rails] dealing with complex query by find_by_sql

2009-04-23 Thread Sijo Kg
Hi I have a query like sql = "SELECT count(DISTINCT r.id) as req_count, round(SUM(h.assigned_days)/count(DISTINCT r.id),1) as avg_days,h.role_id,EXTRACT(YEAR from r.created_at)||'-'||EXTRACT(MONTH from r.created_at) as period, max(r.created_at) as created_date FROM my_requests r, my_request_hi

[Rails] Re: How to include a helper method in a controller

2009-04-22 Thread Sijo Kg
Did you try like include PhonenumberHelper in mailings_controller.rb and is phonenumber_helper.rb in app/helpers? Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] open flash chart and ajax

2009-04-21 Thread Sijo Kg
Hi I want to refresh a graph For that what should I do.The following is an example from the site My controller code like def dashboard @graph = open_flash_chart_object(600,300,"#{request_summary_graph_path}", true) end def draw_summary_graph g = Graph.new g.title( 'Users vs. Ram -

[Rails] Spreadsheet -avoid reading and writing from file how?

2009-04-15 Thread Sijo Kg
Hi I am using http://spreadsheet.rubyforge.org/ in my application..Usage like book = Spreadsheet::Workbook.new book.write "#{RAILS_ROOT}/public/uploads/excel-file.xls" render :file => "#{RAILS_ROOT}/public/uploads/excel-file.xls" headers['Content-Type'] = "application/vnd.ms-excel" he

<    1   2   3   4   >