[Rails] Access belongs_to on a Mongoid::Document subclass

2013-05-07 Thread Myth17
I have a model 'Index' as: class Index include Mongoid::Document belongs_to :project end Another model PercentileRankIndex inherits Index class PercentileRankIndex < Index def self.model_name Index.model_name end end Suppose I do : p = Index.first (OR EVEN) p = P

Re: [Rails] Defining Relationship ( Many to Many) for 3 Models in Rails

2013-03-26 Thread Myth17
On Tuesday, March 26, 2013 3:13:05 PM UTC+5:30, Colin Law wrote: > On 26 March 2013 09:33, Myth17 > wrote: > > Grade is anything like 4,5 or say HighSchool with a 'name' and > 'description' > > attribute. > > Please don't top post, it

Re: [Rails] Defining Relationship ( Many to Many) for 3 Models in Rails

2013-03-26 Thread Myth17
Grade is anything like 4,5 or say HighSchool with a 'name' and 'description' attribute. On Tuesday, March 26, 2013 2:45:16 PM UTC+5:30, Colin Law wrote: > > On 26 March 2013 08:29, Myth17 > wrote: > > I have three models in Rails as : Curriculum, Grade and

[Rails] Defining Relationship ( Many to Many) for 3 Models in Rails

2013-03-26 Thread Myth17
I have three models in Rails as : Curriculum, Grade and Topics. The relationship scenario is like : Curriculum 'International Baccalaureate(IB)' in grade '6' has_many Topics ( t1,t2,t3 and CompareFraction) Curriculum 'CBSE' in grade '5' has_many Topics (t1,t2,t4,t5 and CompareFraction) [ A T

[Rails] Searching database in Rails with multiple optional parameters

2012-12-29 Thread Myth17
I have a Rails app with following schema: User (id, username, user_type, master_id) Item ( id,itemname,master_id) Repairs (id, in_date, out_date, user_id, item_id) The app is small so I have tried keeping db as simple as possible. A user can be Admin, Dealer or Manager. A manager can have man

[Rails] Re: Getting mysql gem working with ruby-1.9.3 on rvm

2012-03-22 Thread Myth17
rsday, March 22, 2012 4:46:42 PM UTC+5:30, Geraldo Andrade wrote: > > I have solved this problem using chown > > On 21 mar, 13:50, Myth17 wrote: > > Hello Everyone > > > > I am trying to setup mysql gem on ruby-1.9.3 installed with rvm. I want > to > > s

Re: [Rails] Getting mysql gem working with ruby-1.9.3 on rvm

2012-03-22 Thread Myth17
No help! :( On Thursday, March 22, 2012 2:08:45 PM UTC+5:30, Maksim Morozov wrote: > > try: rm -rf /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/mysql-2.8.1/ > and gem install mysql again > don't mix rvm and sudo if you don't use Multi-User install of rvm > > On Thu, Mar

Re: [Rails] Getting mysql gem working with ruby-1.9.3 on rvm

2012-03-21 Thread Myth17
2012 at 8:50 PM, Myth17 wrote: > >> Hello Everyone >> >> I am trying to setup mysql gem on ruby-1.9.3 installed with rvm. I want >> to set up the 'redmine'. To install mysql gem I used --> >> sudo env ARCHFLAGS="-arch x86_64" gem install --no-rd

[Rails] Getting mysql gem working with ruby-1.9.3 on rvm

2012-03-21 Thread Myth17
Hello Everyone I am trying to setup mysql gem on ruby-1.9.3 installed with rvm. I want to set up the 'redmine'. To install mysql gem I used --> sudo env ARCHFLAGS="-arch x86_64" gem install --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/bin/mysql_config When I issue --> RAILS_ENV=pr

Re: [Rails] Trying to setup Redmin: Error executing rake generate_session_store

2012-03-21 Thread Myth17
Thanks! I got it running! :) On Wednesday, March 21, 2012 5:26:11 PM UTC+5:30, Morozov Maksim wrote: > > obviously you have no luck with trunk, switch back to 1.8.7 and use last > stable http://www.redmine.org/projects/redmine/wiki/Download > > On Wed, Mar 21, 2012 at 3:35 PM

Re: [Rails] Trying to setup Redmin: Error executing rake generate_session_store

2012-03-21 Thread Myth17
e follow the guide > http://www.redmine.org/projects/redmine/wiki/RedmineInstall > > On Wed, Mar 21, 2012 at 2:29 PM, Myth17 wrote: > >> I am trying to setup redmine on OSX Lion with ruby1.9.2 with rvm. >> >> mythlabs:redmine-1.3.2 myth$ rake generate_session_store

[Rails] Trying to setup Redmin: Error executing rake generate_session_store

2012-03-21 Thread Myth17
I am trying to setup redmine on OSX Lion with ruby1.9.2 with rvm. mythlabs:redmine-1.3.2 myth$ rake generate_session_store NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from /Users/myth/Learn/Code/GSOC 2012/redmine-1.

Re: [Rails] Re: Sharing session variables across Controllers?

2012-03-08 Thread Myth17
I can see message "WARNING: Can't verify CSRF token authenticity" on the rails console. Could this be the reason? On Thursday, March 8, 2012 9:17:08 PM UTC+5:30, Myth17 wrote: > > Its actually weird then, I did a search to double check but I am not > clearing the ses

Re: [Rails] Re: Sharing session variables across Controllers?

2012-03-08 Thread Myth17
Its actually weird then, I did a search to double check but I am not clearing the session anywhere. :| On Thursday, March 8, 2012 8:59:01 PM UTC+5:30, Colin Law wrote: > > On 8 March 2012 15:06, Myth17 wrote: > > In my application once I call an action on a different contr

[Rails] Re: Sharing session variables across Controllers?

2012-03-08 Thread Myth17
In my application once I call an action on a different controller all my session variables seem to disappear also the login session seems to expire. Even if I start a new request from browser I need to authenticate again. On Thursday, March 8, 2012 8:28:47 PM UTC+5:30, Tim Shaffer wrote: > > S

[Rails] Sharing session variables across Controllers?

2012-03-08 Thread Myth17
I have a couple of session parameters set in a Controller which I want to use in a different Controller. Which is the cleanest way to do this? I did quite a bit of Googling but could not come up with anything substancial. -- You received this message because you are subscribed to the Google Gr

[Rails] Re: NoMethodError (undefined method `gsub' for #) when gsub was never used!

2012-03-05 Thread Myth17
Replacing open with read solved this issue. Thanks everyone! On Monday, March 5, 2012 6:53:34 PM UTC+5:30, Myth17 wrote: > > I am presented with this error in my code, the line number happens to be > --> > > Filestore.create(:filename => uploaded_file.original

Re: [Rails] NoMethodError (undefined method `gsub' for #) when gsub was never used!

2012-03-05 Thread Myth17
I was incorrectly using instance variables which I replaced with session variables. However the problem persists. On Monday, March 5, 2012 7:13:38 PM UTC+5:30, Colin Law wrote: > > On 5 March 2012 13:23, Myth17 wrote: > > I am presented with this error in my code, the line number h

Re: [Rails] NoMethodError (undefined method `gsub' for #) when gsub was never used!

2012-03-05 Thread Myth17
I used the puts with 'instance'.class to check the types and they match as well. On Monday, March 5, 2012 7:13:38 PM UTC+5:30, Colin Law wrote: > > On 5 March 2012 13:23, Myth17 wrote: > > I am presented with this error in my code, the line number happens to be > --&

Re: [Rails] NoMethodError (undefined method `gsub' for #) when gsub was never used!

2012-03-05 Thread Myth17
FileStore is my model name and I have a table too. On Monday, March 5, 2012 7:13:38 PM UTC+5:30, Colin Law wrote: > > On 5 March 2012 13:23, Myth17 wrote: > > I am presented with this error in my code, the line number happens to be > --> > > > &

[Rails] NoMethodError (undefined method `gsub' for #) when gsub was never used!

2012-03-05 Thread Myth17
I am presented with this error in my code, the line number happens to be --> Filestore.create(:filename => uploaded_file.original_filename , :fileblob => uploaded_file.open, :bunch => @current_bunch ) The code directly uses gsub nowehere, what could be the possible issue? -- You received this

Re: [Rails] How to retrieve a FileBlob from 'ActionDispatch::Http::UploadedFile' instance?

2012-03-04 Thread Myth17
I have read it, however it does not talk about how to store the fileblob server side. The Upload is working successfully, I am just clueless on how to handle the instance server side. On Sunday, March 4, 2012 10:41:15 PM UTC+5:30, Colin Law wrote: > > On 4 March 2012 06:42, Myth17 wrote:

[Rails] Re: How to retrieve a FileBlob from 'ActionDispatch::Http::UploadedFile' instance?

2012-03-04 Thread Myth17
gt; "http://api.rubyonrails.org/"; into search box. > > On Mar 4, 8:42 am, Myth17 wrote: > > I have used 'remotipart' gem to upload files asynchronously to server > side. > > The instance passed to the server side is of 'UploadedFile' . > &

[Rails] How to retrieve a FileBlob from 'ActionDispatch::Http::UploadedFile' instance?

2012-03-03 Thread Myth17
I have used 'remotipart' gem to upload files asynchronously to server side. The instance passed to the server side is of 'UploadedFile' . The Rails API mentions all the methods( like read(), open() ) and attributes for the class, however I am not sure how to retrieve the File and store it on

[Rails] Multiple AJAX '#url_token' on a base URL with Rails3

2012-02-11 Thread Myth17
I am working on a Web Application with rails which is more of a single page ( think a dashboard ) I want a left side strip fetching a list with and a main app area to the left rendering most of the Application (All with jQuery) In Rails I have a single controller Dashboard for now. I want the