Ok, of course you can do this. The thing that you should pay attention to
is that when the user fill the information in your special form in the home
page (including user_email, user_password, micropost_content) you should
authorize the user first by his/her user_email and password and the
Thank you for the help. Putting @micropost = Micropost.new in
pages_controller.rb solved this error. However, I now have a new error
which states undefined method `humanize' for nil:NilClass. It says the
error is at the line %= f.label @user.email %br /. I defined @user
= User.new in
I restarted the server and it appears to have worked.
--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from
Gautam wrote:
I am getting the following error when trying to link a method in a
view so that it can be called on that very object(id).
undefined method `abc_notice_path' for #ActionView::Base:0xed65220
Extracted source (around line #25):
22: %= link_to 'Edit', edit_notice_path(@notice)
Thanks for your kind reply.
Here is the code of my routes.rb file
Please suggest corrections, if any...
map.resources :notices
map.resources :users, :has_many = :notices
map.resource :session
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
Gautam wrote:
Thanks for your kind reply.
Here is the code of my routes.rb file
Please suggest corrections, if any...
map.resources :notices
map.resources :users, :has_many = :notices
map.resource :session
map.connect ':controller/:action/:id'
map.connect
Billee D. wrote:
Hi John,
I would check your source code in app/views/resources/index.html.haml
(or a view helper for that view) for a typo since it's looking for a
method named something similar to what you have (e.g change
render_index_row_action_pprove to render_index_row_action_approve)
John Merlino wrote:
and this is what I get:
trunk/log/development.log:ActionView::TemplateError (undefined method
`render_index_row_action_pprove' for #ActionView::Base:0x10c5ca938) on
line #20 of app/views/resources/index.html.haml:
So, what's on line #20 of
On 19 March 2010 14:43, John Merlino li...@ruby-forum.com wrote:
Billee D. wrote:
Hi John,
I would check your source code in app/views/resources/index.html.haml
(or a view helper for that view) for a typo since it's looking for a
method named something similar to what you have (e.g change
Hi John,
I would check your source code in app/views/resources/index.html.haml
(or a view helper for that view) for a typo since it's looking for a
method named something similar to what you have (e.g change
render_index_row_action_pprove to render_index_row_action_approve)
HTH
On Mar 18, 7:43
Many thanks, Fred.
Your comments were extremely helpful in that they make sense, but I
don't understand them well enough to actually turn them into action
steps - which suggests I am trying to do things I should not be (yet),
hence my 'fishy' code.
I'll go back and start from scratch on a
On Dec 18, 3:18 pm, SMR srumme...@gmail.com wrote:
Good morning All -
I am working on a time tracking application as a learning excercise
and have run into an error neither I nor Google can remedy.
When loading my view, I get an error: 'undefined method
'true_class_path' for
Thanks. I was missing the map.resources to that model. I didn't add a
helper and it still seems to work. In any case, this was a manually
created model, instead of using the Rails script, so that's why it was
missing for me.
Thanks again.
On Jul 12, 8:40 pm, Frederick Cheung
Nathan Beyer wrote:
[...]
In any case, this was a manually
created model, instead of using the Rails script, so that's why it was
missing for me.
No. script/generate model doesn't generate map.resources statements.
You always have to do those yourself if you want them.
Best,
--
Marnen
On Jul 13, 2:12 am, Nathan Beyer nbe...@gmail.com wrote:
I have a simple controller that takes a request, looks up some data
and then returns the results as either HTML or Atom. The HTML response
works fine, but the Atom Builder is blowing up with an undefined
method error that I can't
On Apr 3, 12:37 am, Rick rfw...@btinternet.com wrote:
Hi Frederick,
Once again thankyou for taking the time to respond.
I am a little confused by your response.
Your method seems to suggest that I pass an argument/array into the
method.
@phonecalls should already contain all of the
On 2 Apr 2009, at 11:35, Rick wrote:
Hi I am learning rails and have hit a bit of a wall.
I have created methods previousley that work fine on a single object.
However in my latest project I am trying to calculate the total cost
of a group of phonecalls and I am having difficulty creating
On 2 Apr 2009, at 11:59, Frederick Cheung wrote:
In my controller I am finding the @phonecalls
And in my view I want to say @phoncalls.total_cost
The easiest way is probably to create a class method that takes as an
argument the array and returns the total cost.
You could also run in your
Hi Matt, Thanks for your time.
I thought that by putting my total_cost method in the phonecall model
that I was doing exactly that.
I appreciate that I can use the view shortcut so thanks for that tip.
I do need to understand how to create methods that act upon an array
of objects both in this
On Apr 2, 2:00 pm, Rick rfw...@btinternet.com wrote:
On Apr 2, 11:59 am, Frederick Cheung frederick.che...@gmail.com
wrote:
Hi Fred thnaks for your time.
I thought that I had created a class method in the (phonecall class) .
Do you mean in the array class? And how do I do that. Is it
Hi Frederick,
Once again thankyou for taking the time to respond.
I am a little confused by your response.
Your method seems to suggest that I pass an argument/array into the
method.
@phonecalls should already contain all of the array data, no? Why do I
need to pass this in. Cant I just
On 28 Dec 2008, at 17:04, Daniel wrote:
OK. I have 4 models, item/category/subcategory/brand
association like following
item
belongs_to :brands
belongs_to :categories
belongs_to :subcategories
belongs_to should be singular
Fred
brand
has_many :items
category
has_many :items
Hi Fred,
Sorry that's my fault.
in my code actually it's singular. Because brand part works fine :-)
item
belongs_to :brand
belongs_to :category
belongs_to :subcategory
belongs_to should be singular
Fred
--~--~-~--~~~---~--~~
You received this message
Thanks a bunch, that helped. Didn't know that --- is meant to
represent an array, YAML::dump could be more intuitive there. It only
told me object, so I never even thought of an array. Well, now it
works, so thanks again!
--~--~-~--~~~---~--~~
You received this
24 matches
Mail list logo