[Rails] integrate menu like a module

2013-01-17 Thread guillaume toto
Hi, i'm new with ruby and MVC, I have my application with my main view application that i will find in all pages of my website. ... #MENU HERE <%= yield %> i wanted to know what is the better way to integrate a menu inside, but in another view ... like

Re: [Rails] Comment has_many comments

2013-01-17 Thread Walter Lee Davis
On Jan 17, 2013, at 5:31 PM, Walter Lee Davis wrote: > > On Jan 17, 2013, at 5:01 PM, Colin Law wrote: > >> On 17 January 2013 21:51, Walter Lee Davis wrote: >>> >>> On Jan 17, 2013, at 1:32 PM, Роман Пружанский wrote: >>> Hi, I want to create web application where people can

Re: [Rails] Comment has_many comments

2013-01-17 Thread Walter Lee Davis
On Jan 17, 2013, at 5:01 PM, Colin Law wrote: > On 17 January 2013 21:51, Walter Lee Davis wrote: >> >> On Jan 17, 2013, at 1:32 PM, Роман Пружанский wrote: >> >>> Hi, >>> >>> I want to create web application where people can discuss some things. >>> There will be a Posts and users can commen

Re: [Rails] Comment has_many comments

2013-01-17 Thread Colin Law
On 17 January 2013 21:51, Walter Lee Davis wrote: > > On Jan 17, 2013, at 1:32 PM, Роман Пружанский wrote: > >> Hi, >> >> I want to create web application where people can discuss some things. >> There will be a Posts and users can comment it, but I also want users can >> comment commentaries. >>

Re: [Rails] Comment has_many comments

2013-01-17 Thread Walter Lee Davis
On Jan 17, 2013, at 1:32 PM, Роман Пружанский wrote: > Hi, > > I want to create web application where people can discuss some things. > There will be a Posts and users can comment it, but I also want users can > comment commentaries. > Can I create model comment, that belongs_to comment and has

Re: [Rails] Comment has_many comments

2013-01-17 Thread Colin Law
On 17 January 2013 18:32, Роман Пружанский <19pr...@gmail.com> wrote: > Hi, > > I want to create web application where people can discuss some things. > There will be a Posts and users can comment it, but I also want users can > comment commentaries. > Can I create model comment, that belongs_to co

[Rails] Comment has_many comments

2013-01-17 Thread Роман Пружанский
Hi, I want to create web application where people can discuss some things. There will be a Posts and users can comment it, but I also want users can comment commentaries. Can I create model comment, that belongs_to comment and has_many comments, or smth similar? I only studying Rails. Sorry for

Re: [Rails] Facebook login on mobile app through a rails app

2013-01-17 Thread Ignacio Piantanida
2013/1/17 Nicolas Desprès > > > On Wed, Jan 16, 2013 at 6:17 PM, Vitor HP wrote: > >> Hi folks. >> > > Hi, > > >> >> I'm building a rails app that provides an api for a mobile app. >> >> I have the same setup. > > >> The mobile app requires the user to login through his facebook account. >> >> M

Re: [Rails] How would I model has_many and also mark one of the 'many' as special?

2013-01-17 Thread Walter Lee Davis
On Jan 17, 2013, at 11:30 AM, Emily S wrote: > class Person < ActiveRecord::Base > attr_accessible :photo, :name > has_many :photos, :as => :attachment, :dependent => :destroy > > # I would do this. This will save a portrait_id on a person object, which > is the id of a photo. This is

Re: [Rails] How would I model has_many and also mark one of the 'many' as special?

2013-01-17 Thread Emily S
class Person < ActiveRecord::Base attr_accessible :photo, :name has_many :photos, :as => :attachment, :dependent => :destroy # I would do this. This will save a portrait_id on a person object, which is the id of a photo. This is most efficient because if you put the "belongs_to" associ

Re: [Rails] Highload project on RoR

2013-01-17 Thread Matt Jones
On Wednesday, 16 January 2013 11:06:56 UTC-5, Vitaly Zemlyansky wrote: > > Currently, I don't have problems. Oh, you've got a problem alright - and it's called "premature optimization". > As I wrote, I am just expecting that most problems will be with DB's. > Stop expecting, and start

[Rails] Re: STI, #update_attributes and validations.

2013-01-17 Thread Matt Jones
On Monday, 14 January 2013 13:34:29 UTC-5, Guilherme Reis wrote: > i could put :if => proc { |record| record.type == 'C' } on the validations > and put the validations at A class. But it wouldn't make sense to have the > subclasses. The difference basically of B and C is only in the validati

[Rails] Re: Need help even generating a new app

2013-01-17 Thread Robert Walker
Josh Aronoff wrote in post #1092595: > Ok cool... Ugh, this permissions thing is driving me nuts. Can I just > uninstall everything by deleting all the directories and re running the > ruby and rails instals using either homebrow or rvm? to be clear, I'm > only saying delete the ruby directory in m

Re: [Rails] Setting image

2013-01-17 Thread Jim Ruther Nill
On Thu, Jan 17, 2013 at 9:52 PM, Avi wrote: > The requirement is:- > > When we click on the button to choose the file, after choosing, the image > should be shown in the ui in IFRAME or something. > Not sure how to do that... > this is a shameless plug but you can look at my blog if you need hel

[Rails] Help with stubbing Twitter::Client in Unit Test

2013-01-17 Thread Ben Densmore
Hi All, I recently added some code to a model Object named EmailUser in my app so that we can grab a users number of followers from their Twitter account. The code works fine but my Unit Test is failing now. I'm fairly certain I should stub this new code but have failed at all the attempts I've

Re: [Rails] Setting image

2013-01-17 Thread Avi
The requirement is:- When we click on the button to choose the file, after choosing, the image should be shown in the ui in IFRAME or something. Not sure how to do that... On Thursday, January 17, 2013 7:08:05 PM UTC+5:30, jim wrote: > > > > > On Thu, Jan 17, 2013 at 6:27 PM, Avi >wrote: > >>

Re: [Rails] Setting image

2013-01-17 Thread Jim Ruther Nill
On Thu, Jan 17, 2013 at 6:27 PM, Avi wrote: > Hello All, > > I am uploading an image from disc. While choosing the image I want to show > that image on the UI. > How can I do that? > I am using paperclip gem. > before html5, i think this is not possible since javascript shouldn't have access to

Re: [Rails] Setting image

2013-01-17 Thread Ashokkumar Yuvarajan
Hi Avi, Good Day, Follow this url, very simple. Use it and enjoy. http://saravani.wordpress.com/2012/03/14/preview-of-an-image-before-it-is-uploaded/ Thanks, Maddy :) On Thu, Jan 17, 2013 at 3:57 PM, Avi wrote: > Hello All, > > I am uploading an image from disc. While choosing the image I wa

[Rails] Setting image

2013-01-17 Thread Avi
Hello All, I am uploading an image from disc. While choosing the image I want to show that image on the UI. How can I do that? I am using paperclip gem. Thanks, Avi -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group

Re: [Rails] Highload project on RoR

2013-01-17 Thread Simon Riggs
On 16 January 2013 16:06, Vitaly Zemlyansky wrote: > Also I know that projects like FB or Twitter use both distributed DB and > relational DB(MySQL), and I wonder Why do they use both models ? What > benifits do you get by this approach ? The relational model allows you to store more complex dat

Re: [Rails] Facebook login on mobile app through a rails app

2013-01-17 Thread Nicolas Desprès
On Wed, Jan 16, 2013 at 6:17 PM, Vitor HP wrote: > Hi folks. > Hi, > > I'm building a rails app that provides an api for a mobile app. > > I have the same setup. > The mobile app requires the user to login through his facebook account. > > My question is about who should be responsible for r

Re: [Rails] how to show different markers for current location and nearby locations in gmaps4rails

2013-01-17 Thread Colin Law
On 17 January 2013 05:09, hari krishna wrote: > Hai guys, > > Iam using gmaps4rails to show gmaps in my application.iam getting the > map pointa right but iam unable to differentiate the current location > and nerby locations in my map.my idea is to use different markers for > two locations i did