[Rails] Re: what is the difference between using group_by in a scope as opposed the controller?

2011-07-14 Thread frankjmat...@gmail.com
> frankjmat...@gmail.com> wrote: > > In my controller I have this and it works. > > > @grouped_by_assignable = collection.order("updated_at desc").group_by > > { |assignment| assignment.assignable } > > > trying to refactor it into a scope on the mo

[Rails] what is the difference between using group_by in a scope as opposed the controller?

2011-07-13 Thread frankjmat...@gmail.com
In my controller I have this and it works. @grouped_by_assignable = collection.order("updated_at desc").group_by { |assignment| assignment.assignable } trying to refactor it into a scope on the model as such scope :grouped_by_assignable, order("updated_at desc").group_by { | assignment| assignme

[Rails] Re: all custom helper modules being made available to all controllers without a call to helper?

2010-07-19 Thread frankjmat...@gmail.com
My apologies, I should have mentioned my environment in my first post: Rails 3 tracking git Ruby 1.9.2-rc1 On Jul 19, 5:30 pm, "frankjmat...@gmail.com" wrote: > I have three different helper modules in my helpers directory > (authentication_helper.rb... etc). In my views and

[Rails] all custom helper modules being made available to all controllers without a call to helper?

2010-07-19 Thread frankjmat...@gmail.com
I have three different helper modules in my helpers directory (authentication_helper.rb... etc). In my views and partials I have calls to them but application_controller never directly calls the method #helper directly (as in helper AuthenticationHelper or helper :layout)... Shouldn't calls to tho

[Rails] Re: extracting a portion of a model to a separate file

2010-06-25 Thread frankjmat...@gmail.com
On Jun 25, 9:58 am, Marnen Laibow-Koser wrote: > frankjmat...@gmail.com wrote: > > G'day, > > > I have a project that relies heavily on pluginaweeks "state_machine" > > gem. While I would have liked to post this to a state_machine forum, > > 1.

[Rails] Re: Error installing gems for Rails 3.0.0.beta4 on MacOSx

2010-06-25 Thread frankjmat...@gmail.com
that goes. On Jun 25, 3:15 am, Andre Cubeta wrote: > frankjmat...@gmail.com wrote: > > Also I should have noted, after you get rails installed and run > > rails new MyNewAppName you should cd to that directory and run > > bundle install > > that will install all of your gem

[Rails] extracting a portion of a model to a separate file

2010-06-24 Thread frankjmat...@gmail.com
G'day, I have a project that relies heavily on pluginaweeks "state_machine" gem. While I would have liked to post this to a state_machine forum, 1. I couldn't find one and 2. this is probably a generic ruby concept that I just can't piece together on my own - so asking here may be *more* appropria

[Rails] Re: Error installing gems for Rails 3.0.0.beta4 on MacOSx

2010-06-24 Thread frankjmat...@gmail.com
Also I should have noted, after you get rails installed and run rails new MyNewAppName you should cd to that directory and run bundle install that will install all of your gem dependencies from your Gemfile and you shouldn't get that sqlite3-ruby error anymore. On Jun 25, 1:00 am, "

[Rails] Re: Error installing gems for Rails 3.0.0.beta4 on MacOSx

2010-06-24 Thread frankjmat...@gmail.com
Hey Andre, I would recommend a few things that could make your life easier. Use RVM. It allows you to easily install a local user copy of ruby without mucking about with your system. Follow the instructions at http://rvm.beginrescueend.com/rvm/install/ and remember - you don't have to be root. In

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
> No. It has *nothing* to do with appearance. PUT is for updating an > existing resource (generally through a form). and i am updating a resource... i'm not using #update_attributes, but in my controller I am saving. > I think that the need for a PUT link does not exist, period. If your > app

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
> >> In any case, the arguments are whatever is defined in that particular > >> route. Run rake routes or look at your routes file to see what that > >> would be. > > > That doesn't make any sense. > > Whether it makes sense or not, it is the case. :)  The arguments are the > :parameters in the rou

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
On May 19, 11:29 am, Marnen Laibow-Koser wrote: > frankjmat...@gmail.com wrote: > > yeah, i've read it half a dozen times > > Read *what*?  Please quote when replying so it's clear what you're > responding to. I have read the rails routing guide a dozen times.

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
:09 am, Marnen Laibow-Koser wrote: > frankjmat...@gmail.com wrote: > > where can i find the documentation for all of the > > action_controller_path functions? > > > multiple submits on a form are no longer a viable solution because the > > only way to tell which one was hit was

[Rails] [solved] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
here's what i ended up doing -- if anyone can find a technical flaw with it (like someone being able to trigger things just by messing with urls) let me know. hopefully this helps someone else. in my view i have <% unless @machine.new_record? %> <%= link_to 'service', machine_path(@machine, :ev

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
On Tue, May 18, 2010 at 12:49 PM, frankjmat...@gmail.com > > wrote: > > so i can have a form submit to update, have the submit buttons have > > different values and then in the update action figure out which one > > was clicked? > > Exactly. > > > what is nece

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
so i can have a form submit to update, have the submit buttons have different values and then in the update action figure out which one was clicked? what is necessary beyond f.submit in my view? thanks, - FJM On May 18, 3:40 pm, Hassan Schroeder wrote: > >> i want these buttons to located inside

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
get it to send via put or post? which is the appropriate one? thanks for the input and suggestions but i wont know the right way to take this if i dont start somewhere that i feel is logical to my problem - and then discovering the pros/cons from where im at - and then moving forward.. - FJM &

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
eally help me too much. On May 18, 2:16 pm, Marnen Laibow-Koser wrote: > frankjmat...@gmail.com wrote: > > i'll try another example, maybe it'll be a little clearer - also, ill > > take SM out of the equation. > > > suppose theres a job edit page... th

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
untered, execute my mark and dupe methods. does that make sense? maybe im trying to fit the wrong solution to the problem but in my interface this seems like hte most appropriate solution. thanks again, - FJM On May 18, 12:27 pm, Colin Law wrote: > On 18 May 2010 17:06, frankjmat...@gmail.

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
>   station.save! > > Any event that gets set in "state_event" will be validated and fired > when the record is saved.  There's a full example (model, controller, > and views) of this > here:http://github.com/pluginaweek/state_machine/tree/master/examples/rail..

[Rails] staying RESTful and triggering actions without saving a record.

2010-05-17 Thread frankjmat...@gmail.com
the example i'm making uses state_machine because it's part of my current setup but this isnt a state_machine specific problem. i have a model called Station. it's an abstract concept for "an area in which work is performed"... when i'm using the app the Stations could be anything from "simulation

[Rails] Re: rails, dynamic tables and erp/crm

2010-01-07 Thread frankjmat...@gmail.com
hinking its going to be a lot of trouble... hopefully nt more than its worth. however, if i can invent a better wheel i'd love to share it with the world... so that kinda urges me to push forward. On Jan 7, 1:07 pm, Marnen Laibow-Koser wrote: > frankjmat...@gmail.com wrote: > > wel

[Rails] Re: rails, dynamic tables and erp/crm

2010-01-07 Thread frankjmat...@gmail.com
Laibow-Koser wrote: > frankjmat...@gmail.com wrote: > > the question that could summarize this in a nutshell is this: > > > does the orm structure of rails make it a poor framework to implement > > a small erp/crm solution? > > No.  It should be fine. > > > >

[Rails] rails, dynamic tables and erp/crm

2010-01-06 Thread frankjmat...@gmail.com
the question that could summarize this in a nutshell is this: does the orm structure of rails make it a poor framework to implement a small erp/crm solution? if you got that then please read ahead - i need some suggestions... ive been making an app for my small business. now believe me, i know t

[Rails] has_many through but with one table?

2009-08-20 Thread frankjmat...@gmail.com
Maybe I'm looking at this the wrong way and with that - hopefully someone can either suggest a simpler way or the right way. I have a Quote model - for all intents and purposes, just say it has one attribute :price. I want to be able to add the following self-referential attributes (which I *thi

[Rails] fixtures, factories and the standard testing framework.

2009-08-10 Thread frankjmat...@gmail.com
A little background: I've been enjoying rails for about a year now tinkering on meaningless projects here solely for the purpose of learning the framework... not because I actually needed to use those apps for anything serious. Now that I started writing my first serious app, naturally I want to d

[Rails] forms, javascript and ajax - hopefully an easy question

2009-08-04 Thread frankjmat...@gmail.com
Right now I have a simple form hooked up. Now that the form is smooth and functional, I want to add a feature that I'm not sure how to implement. After a user modifies a form, I'd like to have a visual cue appear somewhere to show that the form has been changed and needs to be saved. It could be

[Rails] Re: sparse tables seems to be an impossible term to search on google

2009-02-10 Thread frankjmat...@gmail.com
<% @table.rows.each do |row| %> >     >       <% row.table.columns.each do |col| %> >         >           <%= h row.get_cell(col) %> >         >       <% end # cell %> >     >   <% end # row %> > > > - Roy > > -Original Me

[Rails] Re: sparse tables seems to be an impossible term to search on google

2009-02-10 Thread frankjmat...@gmail.com
pepe wrote: > I am not an expert by any means on this, I am just trying to offer a > suggestion, but have you thought about storing the data as XML? If you > do it right you should be able to extract the information you need > very easily. > > Pepe > > On Feb 10,

[Rails] Re: sparse tables seems to be an impossible term to search on google

2009-02-10 Thread frankjmat...@gmail.com
er (and TCP/IP communication between them)--is the database > processing on the server really the bottleneck? > > At least one more comment interspersed below. > > On Tuesday 10 February 2009 09:37 am, frankjmat...@gmail.com wrote: > > > > > > > ive toyed around with just us

[Rails] Re: sparse tables seems to be an impossible term to search on google

2009-02-10 Thread frankjmat...@gmail.com
elegent solution im not advanced enough to see. On Feb 10, 8:59 am, Randy Kramer wrote: > On Tuesday 10 February 2009 08:31 am, frankjmat...@gmail.com wrote: > > > What I'm really looking for is a technical explaination of the > correct/ > > incorrect way to acheive thi

[Rails] Re: sparse tables seems to be an impossible term to search on google

2009-02-10 Thread frankjmat...@gmail.com
separate tables for the columns, column groups, rows, tables... but in the end - merging all the tables together and iterating over everything just seems to take forever... not in the least bit efficient or reliable. On Feb 10, 8:28 am, "frankjmat...@gmail.com" wrote: > ah, thank you.

[Rails] Re: sparse tables seems to be an impossible term to search on google

2009-02-10 Thread frankjmat...@gmail.com
thanks, - FJM On Feb 10, 7:46 am, Randy Kramer wrote: > On Tuesday 10 February 2009 12:05 am, frankjmat...@gmail.com wrote: > > > ive asked this question a half a dozen different ways and none have > > ever gotten an answer. > > (Just an aside--is everybody switching to t

[Rails] Re: sparse tables seems to be an impossible term to search on google

2009-02-09 Thread frankjmat...@gmail.com
ive asked this question a half a dozen different ways and none have ever gotten an answer. is it really such a bad idea? some feedback would be welcome... or maybe a point in the direction of the appropriate forum for these kinds of questions. - FJM On Feb 9, 10:34 am, "frankjmat...@gmai

[Rails] sparse tables seems to be an impossible term to search on google

2009-02-09 Thread frankjmat...@gmail.com
without bringing up 3000 articles on low languages and theory which i am not looking for. i just want some pointers to effectively storing variable column sparse tables in ruby/rails preferably with a lean towards pulling them all together in a cohesive table... afaik i need a table for my rows