And with fresh morning eyes, I solved that too.
(T'was another concept where it should have been part -- another
victim of copy-pasting controller code.)
s.
On Sep 13, 7:22 am, steven_noble wrote:
> I'm an idiot. Perils of copy-pasting controllers and then starting at
> th
oject validations and
complains about there being no project name, etc.
Colin, the submit code is:
submit_tag 'Save', :name => 'save'
On Sep 13, 12:10 am, Colin Law wrote:
> 2009/9/12 steven_noble :
>
>
>
>
>
> > When I click the Save in /views/par
When I click the Save in /views/parts/new.html, I expect to end up on /
views/parts/show.html, but instead I end up in /views/projects/
index.html, with the wrong [flash] message.
I have:
/models/project.rb
has_many :parts
/mo
OK, I added a town_id to each house and it's working fine, but if
there's a method I've missed that handles this automagically, it'd be
great to know.
s.
On Sep 8, 10:21 pm, steven_noble wrote:
> Let's say...
>
> class Town < ActiveRecord::Base
>
Let's say...
class Town < ActiveRecord::Base
has_many :streets
has_many :houses, :through => :streets
end
class Street < ActiveRecord::Base
has_many :houses
end
Then we can find individual streets and houses like this...
@first_town = Town.find(:first)
@first_towns_first_street = @first_
action=>"new", :parent => @project.id}) %>
# app/views/projects/new.html.erb
<% form_for(@project) do |f| %>
...
<%= f.hidden_field :parent_id, {:value => @parent} %>
...
<% end %>
On Aug 7, 9:00 am, steven_noble wrote:
> Sorry:
>
Sorry:
<%= link_to("Split Project Into Parts",
{:controller=>"projects", :action=>"new", :parent => @project.id}) %>
On Aug 7, 8:58 am, steven_noble wrote:
> I understand that's how you retrieve the value from the URL. My
> question rela
lt;%= link_to("Split Project Into Parts",
{:action=>"new_project_path", :parent => @project.id}) %>
On Aug 7, 7:21 am, Marnen Laibow-Koser wrote:
> steven_noble wrote:
> > Hi Marnen,
>
> > Thanks for sticking with me and sorry for not yet getting it.
>
ojects/new with
the following?
<%= debug :parent %>
s.
On Aug 7, 7:03 am, Marnen Laibow-Koser wrote:
> steven_noble wrote:
> > Thanks. I'll try awesome_nested_set.
>
> > Iian seemed to be suggesting params[:parent] went into projects/new,
> > but I'm struggli
Thanks. I'll try awesome_nested_set.
Iian seemed to be suggesting params[:parent] went into projects/new,
but I'm struggling to get a value to projects/new (via :parents) in
the first place, I assume for the reasons you've given.
Are you saying that params[:parent] goes into link_to to help me
Thanks Iian. I think the problem might be in my use of the following
in the projects/show view:
<%= link_to 'Create Subproject', new_project_path, :parent =>
@project.id %>
I have <%= debug @project.id %> in that projects/show view, which
gives me:
--- 21
However, in the subsequent pro
Thanks Iian. I think the problem might be in my use of the following
in the projects/show view:
<%= link_to 'Create Subproject', new_project_path, :parent =>
@project.id %>
I have <%= debug @project.id %> in that projects/show view, which
gives me:
--- 21
However, in the subsequent pro
I have:
#
In the Projects model...
acts_as_tree :order => "name"
###
In the Projects/show view...
<%= link_to 'Create Subproject', new_project_path, { :parent =>
@project.id } %>
###
In the Projects controller...
def new
@project = Project.new
@project.parent_id = :parent
In case anyone else has this a problem, a work-around is to popular
the Users table using seed_fu.
Then you can just pass it the :password and :password_confirmation,
and your app takes care of generating the salted versions etc.
s.
On Jul 13, 6:19 pm, steven_noble wrote:
> Hi all,
>
&g
In case anyone has a similar problem, a workaround is to populate your
Users table using seed_fu:
http://github.com/mbleigh/seed-fu/tree/master
s.
On Jul 13, 6:19 pm, steven_noble wrote:
> Hi all,
>
> How do you create a data-only migration for my User model that adds a
> passw
Hi all,
How do you create a data-only migration for my User model that adds a
password salt and encrypted password to the Users table?
Also, my model validates the equivalence of :password
and :password_confirmation, neither of which are columns in the Users
table. I need my data-only migration
16 matches
Mail list logo