[Rails] Controller testing with Rspec rails

2014-04-29 Thread ruby rails
Hi, I have written some controller methods and testing it using Rspec. I am just learning the Rspec by testing those methods. I need some hints on how to do it. I have the below method in my QueueItemsController and I need to test it. So how do I proceed. Please help. I read the tutorials and othe

[Rails] Re: Rspec testing in rails3

2014-04-26 Thread ruby rails
Frederick Cheung wrote in post #1144184: > On Saturday, April 26, 2014 4:09:15 PM UTC+1, Ruby-Forum.com User wrote: >> :format => "json" >> ) >> assigns(:queue).should_not be_nil >> expect(response).to be_success >> end >> >> But it is not at all coming i

[Rails] Rspec testing in rails3

2014-04-26 Thread ruby rails
Hi, I have a Queues controller and and QueueItems controller in my rails application. In routes I have defined as below `match 'queues/:queue_id/next', :to=> 'queueitems#next'` In my QueueItems Controller I have a next action and it assigns an instance variable. def next @queue = "Regular

[Rails] Rspec testing in rails3

2014-04-26 Thread ruby rails
Hi, I have a Queues controller and and QueueItems controller in my rails application. In routes I have defined as below `match 'queues/:queue_id/next', :to=> 'queueitems#next'` In my QueueItems Controller I have a next action and it assigns an instance variable. def next @queue = "Regular

[Rails] Configure Restful routes for rails webservice

2014-04-16 Thread ruby rails
Hi, I am trying to create a Rest web service in my rails application. I need to configure urls for it as below. localhost:3000/book/book_id/new/param1/param2/param3/param4/... localhost:3000/book/book_id/next localhost:3000/book/book_id/delete I dont have a view pages for it since

[Rails] alternative for Amazon SQS for ruby

2014-04-08 Thread ruby rails
I need to use ElasticMQ in my rails project. But I dont see any references which have used elasticmq with rails projects. I know that Amazon SQS queuing system can be implemented with the help of right_aws gem(an adapter which is used to connect to Amazon SQS). So I am searching for a similar kind

[Rails] undefined local variable or method `message' (NameError)

2014-04-06 Thread ruby rails
I am trying to learn Rspec-Cucumber tutorial by referring to "The Pragmatic Programmers - The Rspec Book". I am on the 4th chapter and seems to be stuck with an error and not able to move forward.I have followed exactly as per the tutorial but it is showing the below error `( in line : output.messa

[Rails] polymorphic assocation with nested attributes and paperclip issue

2013-10-26 Thread ruby rails
I have a Student model and an AddlDocument model (based on paperclip). class Student < ActiveRecord::Base has_many,:addl_documents, :as => 'receiver', :dependent => :destroy accepts_nested_attributes_for, :addl_documents, :allow_destroy => true end class AddlDocument < A

[Rails] rails fckeditor plugin in 2 forms in a view page

2013-10-23 Thread ruby rails
Hi, I have a view page where there are 2 forms and each form have fckeditor textarea. . SO initially both forms will be hidden on page load. When I click on a link1, the form1 div will be shown and form2 will be hidden and vice versa. But when I click on link1 the form1 div appears the 2 fck text

[Rails] copy rails association in 2.3 with clone method

2013-10-11 Thread ruby rails
I have a Reminder model, Attachment Model and it has habtm relationship with each other. So I have a created another table as attachment_reminders table in mysql through migrations and it has reminder_id and attachment_id fields. In controller I need to copy a record in attachment table and save

[Rails] save attachments to database and Rails application public directory

2013-10-05 Thread ruby rails
I am new to ROR and learning it.I am using Rails 2.3.5. I have a form where I can attach multiple files. I need to save these attachments in my db and also in a directory in my application directory. I dont want to use paperclip plugin as I need to learn File system as well as how to create dir and

[Rails] Paperclip with nested form saving null values in db

2013-10-04 Thread ruby rails
I have a Attachment model and Reminder model. The Reminder has many attachments and Attachment belongs to a Reminder. I have set up the association and it works fine. I have defined accepts_nested_attributes_for :attachments in the Reminder model also. I have a nested form where there is multiple f

[Rails] body of email not displaying with attachments in rails2.3.5

2013-09-29 Thread ruby rails
I am sending an email through my application to other user's gmail id. I am receiving email and it works fine without attachment. But when I attach a file, the mail which users receive contain subject and attachments only. The body part is not displaying in the mail. In the controller I am passing

[Rails] overriding view page in core module through rails plugin

2013-09-17 Thread ruby rails
Hi, I have a rails2.3 application and I have a requirement to override one of the view in the core module through plugin. In the core module view page, there is a text area to type the message. Now the requirement is to make it as like nicedit, redactor so that the message can be formatted. So I n

[Rails] Delete duplicate entries from a 2 dimensional array in ror

2013-09-06 Thread ruby rails
I am trying to loop an array like this.. @mem = [] @tran = Transport.find_all_by_month_and_vehicle(date,vehicle) tran.each do |t| @mem << [Student.find_by_id(t.mem_id), t.transport_date, vehicle.no] if t.mem_type=="Student" @mem << [Employee.find_by_id(t.mem_id), t.transpor

[Rails] Fetching links to my rails app

2013-09-04 Thread Ruby Rails
I am new to RoR and i want to fetch some links from some other websites to my rails app. How can i do so? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[Rails] how to retrieve an aray of only specific attributes in rails 2.3

2013-08-30 Thread ruby rails
I have a scenario where I need to retrieve an array of specific attributes from a table. I have a TransportAttendanceBlock table. In the table I have blocked(boolean) and blocked_date attributes. From a controller I am fetching this table by passing params of date and boolean value. Controller

[Rails] access json data from rails controller in ajax call and process it

2012-12-05 Thread ruby rails
I am building a Task Management System and have implemented fullcalendar.js in it. I need to get the pending tasks and change the color of those pending tasks. I am getting the instance variable of pending tasks details in the rails controller. But in the ajax request I am not able to loop it. Ple

[Rails] insert the javascript codes of another view returned from ajax to a view page

2012-11-17 Thread ruby rails
Hi, I am doing an jquery ajax call in my rails application and in the controller I am rendering it to a view page(where javascripts codes are written). Then I need to insert the response returned from the server to a DOM element. When I try to alert the server response (alert (data))I am getting it

[Rails] pass javascript date variable to rails controller as params

2012-10-30 Thread ruby rails
I have an application where jquery fullcalendar is implemented. On day click I need to pass the selected date as params to rails controller. When I alert the date inside dayclick function, I am getting the date in the format of "Tue Oct 30 2012 12:40:20 GMT+0530 (IST)".. But when I pass as params

[Rails] Routing error in rails

2012-10-26 Thread ruby rails
In my controller I have def update_project_dates p "It is end date." @user=User.find(params[:user]) @projects=Project.find_all_by_user_id(@user) end In the view page (only some part of the code is copied and pasted) eventDrop: function() {

[Rails] Error while embedding ruby code in fullcalendar jquery to display events

2012-10-25 Thread ruby rails
I am trying to display events on my fullcalendar. In my controller I am getting an array of events. But I need to loop it and render it in view page as events array. When I try to do loop it I am getting some syntax error on which I have spent around 3-4 hours and couldn't figure it out. Please hel

[Rails] Run rails application without installing rails

2012-10-24 Thread ruby rails
Is it possible to run a rails application without installing rails gem in ubuntu system.?? If yes, please provide me some reference for it. -- 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 pos

[Rails] generate 10 UUID records and save it it database in rails

2012-10-17 Thread ruby rails
I need to create certain number of UUId records(based on the selection of drop down) and save it in the database. Now I am generating only one unique id. Can this be done in the model in this way. Or do I need to write a helper file for that?? def generate_unique_token=(value)self.secret =

[Rails] Re: Rails form submission not validating

2012-10-16 Thread ruby rails
Colin Law wrote in post #1079996: On 16 October 2012 11:23, ruby rails wrote: I have a form with only one field called secretcode to submit. But when I submit it, the data is saved. But I need to do form validation for this field. I have given validates_presence_of :secret in the Secretcode

[Rails] Rails form submission not validating

2012-10-16 Thread ruby rails
I have a form with only one field called secretcode to submit. But when I submit it, the data is saved. But I need to do form validation for this field. I have given validates_presence_of :secret in the Secretcode Model. when I submit it without entering anything in secret code field, then it is sh

[Rails] Re: Ajax in rails

2012-10-02 Thread ruby rails
;/a>;> nith...@gmail.com ruby rails wrote in post #1078321: > I am building a task management application in ROR. I am new to ROR and > learning it. While adding tasks, I need to select a projects drop down > list and the team members of that project will be shown as drop

[Rails] Ajax in rails

2012-10-02 Thread ruby rails
I am building a task management application in ROR. I am new to ROR and learning it. While adding tasks, I need to select a projects drop down list and the team members of that project will be shown as drop down. I am using ajax for it. But I see that in the response data I am getting the complete

[Rails] adding different title for a single form in rails

2012-09-28 Thread ruby rails
I have a Task management applciation where users can add task and edit it. I am using single form for it. When I render this form for edit and new, I need to assign the different form title for each. Say "Edit task" and "Assign new task". How do I implement it. I am new to rails. Please help. --

[Rails] Displaying an array of events in full calendar

2012-09-26 Thread ruby rails
I am trying to integrate the arshaw's jqurey fullcalendar into my rails application. When I click on the calendar tab it should display the calendar with the list of tasks in the database on the corresponding date. In Calender Controller def index @task=Task.find_all_by_pm_id(par

[Rails] Re: access controller's object attributes in view page

2012-09-20 Thread ruby rails
Rafi A wrote in post #1076789: > Hi, > > See my comments inline: > > Regards, > Seeni Rafiyullah Khan A, > *In Every moment, thank God.* > > > > On Thu, Sep 20, 2012 at 4:15 PM, ruby rails > wrote: > >> >> >> >> >> > You

[Rails] access controller's object attributes in view page

2012-09-20 Thread ruby rails
Hi, I am new to ROR and learning it. In my controller I have an admins record and I am passing that admin object to the admin's view page to get the name of the admin. But when I try to access the name it is showing error as "undefined method `name' for :current_admin:Symbol".. Please help.. Plea

Re: [Rails] commenting in new.erb template file

2010-06-26 Thread ruby rails
Hi, I am looking for Matz and Keiju's book is first published, the first Ruby book.Please mail if any one have, Cheers, Sai On Sun, Jun 27, 2010 at 11:02 AM, Hassan Schroeder < hassan.schroe...@gmail.com> wrote: > On Sat, Jun 26, 2010 at 9:35 PM, RailsFan Radha > wrote: > > > > > > > > > >

[Rails] how to generate the Generating SSH keys in github?

2010-05-09 Thread ruby rails
how to generate the Generating SSH keys in github? -- 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 rubyonrails-talk+uns

[Rails] Re: Problem with MYSQL after re-installing rails

2009-04-07 Thread Ruby Rails
Restart u'r computer or start u'r mysql server.Bassically this error occur due to not running of mysql server. On Tue, Apr 7, 2009 at 4:23 PM, Gavin wrote: > > Hey all- > > Re-installed OSX yesterday and with it, Ruby and Rails > > Now when I try to run db:migrate I get the error message: > > "!

[Rails] Re: rake aborted! undefined method `empty?' for nil:NilClass

2009-04-07 Thread Ruby Rails
Do you read rails documentation properly. On Tue, Apr 7, 2009 at 3:07 PM, Colin Law wrote: > Have you tried going back to the previous version (that worked) and then > moving forward again? > > 2009/4/6 comopasta Gr > > >> Hi, >> >> I'm thinking of re-creating the whole app completely. It is no

[Rails] Re: Storing information in session in rails - How to ?

2009-04-01 Thread Ruby Rails
config.action_controller.session = { :session_key => '_xxx_ui_session', :secret => '70ec05c894289359662252cdfd64e359822861bfd85626d0cc0699b4cef6ab409861e5dce5c9359918cedf4f58fa6fb73e2697ddb32d5ef4bd 4076cf31c1af8d' } this code will work before version 2.3.2 but in rails 2.3.3 it is changed

[Rails] Re: Model newb qustion

2008-09-19 Thread ruby rails
Why not use Single Table Inheritance where you have a column 'type' for storing the type of user. Then you will be having a single User model. I think this might be helpful to you: http://wiki.rubyonrails.org/rails/pages/SingleTableInheritance -- Posted via http://www.ruby-forum.com/. --~--~

[Rails] Re: problem with set_table_name

2008-09-18 Thread ruby rails
dare ruby wrote: > >> >> If you want to change the schema, write a migration. >> > > Dear fred, > > Thanks for your immediate response, how to perform migration for the > above. I have no idea? could you please suggest. > > Thanks in advance > > Regards, > Jose martin its simple... renam