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
combinat
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 %>". I defined @user
= User.new in pages_
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:
> 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 ':contr
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'
map.c
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 #
>
> Extracted source (around line #25):
>
> 22: <%= link_to 'Edit', edit_notice_path(@notice) %> |
> 23: <%= li
On 19 March 2010 14:43, John Merlino 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
>> "render_inde
John Merlino wrote:
>
> and this is what I get:
>
> trunk/log/development.log:ActionView::TemplateError (undefined method
> `render_index_row_action_pprove' for #) on
> line #20 of app/views/resources/index.html.haml:
>
So, what's on line #20 of app/views/resources/index.html.haml ?
--
Poste
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_app
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:4
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 tutoria
On Dec 18, 3:18 pm, SMR 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 #
> Context:
>
> I have co
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
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
wrote:
> On Jul 1
On Jul 13, 2:12 am, Nathan Beyer 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 figure out. It se
On Apr 3, 12:37 am, Rick 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 array data, no
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 create
On Apr 2, 2:00 pm, Rick wrote:
> On Apr 2, 11:59 am, Frederick Cheung
> 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 not
No. (well technically you could create
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 i
On Apr 2, 11:59 am, Frederick Cheung
wrote:
> 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
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
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 cre
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 be
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_m
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
On 18 Dec 2008, at 16:22, Daniel Süpke wrote:
> But when I try to access the attribute "optional", I always get an
> error message!
> <% if articletemplate.articletemplates_reporttemplates.optional == 0
> %>
> leads to
> "undefined method `optional' for #"
>
> Why does it tell me "undefined", whe
c'mon guys, don't leave me hanging on my very first rails question
here ;).
It's basically just: How can the debug output give tell me something
is an object with attributes and then it doesn't let me access this
attributes? Maybe it's a bug. Well, if no one has a clue I will try to
find a bug tr
27 matches
Mail list logo