manually creating a route to...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

manually creating a route to...

Joe Guerra
I've got a pages controller [which is a catch all for most pages on my site] and in it, I have defined an invoice page.

Just a bunch of users I would need to invoice [manually for now]

so, I created a method called 'update_invoice_link'.  how would I manually create this route and what action or url do I need in my form field?

Thanks,
Joe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: manually creating a route to...

Walter Lee Davis
It is really worthwhile googling REST and Rails, and reading about the underlying expectations of the Rails framework. If you do things the way it expects, then your job becomes easier. Not trivially easy, but considerably easier.

Are Invoices structurally different than a Page? Do they need separate rules, or different roles to access them for editing, or a means of payment? I would argue that adding an invoice to a pages_controller would probably mean a lot harder work ahead for you than just creating a separate model and controller to handle these.

Walter

> On Oct 24, 2018, at 11:51 AM, Joe Guerra <[hidden email]> wrote:
>
> I've got a pages controller [which is a catch all for most pages on my site] and in it, I have defined an invoice page.
>
> Just a bunch of users I would need to invoice [manually for now]
>
> so, I created a method called 'update_invoice_link'.  how would I manually create this route and what action or url do I need in my form field?
>
> Thanks,
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/C4FEFF6F-9A79-47AF-BF77-7FDADBEB95F1%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: manually creating a route to...

Joe Guerra
Yes, I know I've run plenty of scaffolds and generated lots of models.

I just didn't think I would need to do this, but now it seems reasonable not to upset the apple cart in order to update one field in a table.

I've already got the method in my controller in my invoicing class - just need to figure out how to link the form and this method thru a route.

Thanks,
Joe

On Wednesday, October 24, 2018 at 12:09:44 PM UTC-4, Walter Lee Davis wrote:
It is really worthwhile googling REST and Rails, and reading about the underlying expectations of the Rails framework. If you do things the way it expects, then your job becomes easier. Not trivially easy, but considerably easier.

Are Invoices structurally different than a Page? Do they need separate rules, or different roles to access them for editing, or a means of payment? I would argue that adding an invoice to a pages_controller would probably mean a lot harder work ahead for you than just creating a separate model and controller to handle these.

Walter

> On Oct 24, 2018, at 11:51 AM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="FGuMPNkRBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jgu...@...> wrote:
>
> I've got a pages controller [which is a catch all for most pages on my site] and in it, I have defined an invoice page.
>
> Just a bunch of users I would need to invoice [manually for now]
>
> so, I created a method called 'update_invoice_link'.  how would I manually create this route and what action or url do I need in my form field?
>
> Thanks,
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FGuMPNkRBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FGuMPNkRBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0287dfdf-9eed-4c2e-830a-8800b380df9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: manually creating a route to...

Joe Guerra
Ok, I created a new controller for invoicing and removed it from my [static] pages controller.

On Wednesday, October 24, 2018 at 1:27:25 PM UTC-4, Joe Guerra wrote:
Yes, I know I've run plenty of scaffolds and generated lots of models.

I just didn't think I would need to do this, but now it seems reasonable not to upset the apple cart in order to update one field in a table.

I've already got the method in my controller in my invoicing class - just need to figure out how to link the form and this method thru a route.

Thanks,
Joe

On Wednesday, October 24, 2018 at 12:09:44 PM UTC-4, Walter Lee Davis wrote:
It is really worthwhile googling REST and Rails, and reading about the underlying expectations of the Rails framework. If you do things the way it expects, then your job becomes easier. Not trivially easy, but considerably easier.

Are Invoices structurally different than a Page? Do they need separate rules, or different roles to access them for editing, or a means of payment? I would argue that adding an invoice to a pages_controller would probably mean a lot harder work ahead for you than just creating a separate model and controller to handle these.

Walter

> On Oct 24, 2018, at 11:51 AM, Joe Guerra <[hidden email]> wrote:
>
> I've got a pages controller [which is a catch all for most pages on my site] and in it, I have defined an invoice page.
>
> Just a bunch of users I would need to invoice [manually for now]
>
> so, I created a method called 'update_invoice_link'.  how would I manually create this route and what action or url do I need in my form field?
>
> Thanks,
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d12b622e-1360-4a2f-85c7-271cf61252f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: manually creating a route to...

Joe Guerra
In reply to this post by Walter Lee Davis
oh I solved my problem.

On Wednesday, October 24, 2018 at 12:09:44 PM UTC-4, Walter Lee Davis wrote:
It is really worthwhile googling REST and Rails, and reading about the underlying expectations of the Rails framework. If you do things the way it expects, then your job becomes easier. Not trivially easy, but considerably easier.

Are Invoices structurally different than a Page? Do they need separate rules, or different roles to access them for editing, or a means of payment? I would argue that adding an invoice to a pages_controller would probably mean a lot harder work ahead for you than just creating a separate model and controller to handle these.

Walter

> On Oct 24, 2018, at 11:51 AM, Joe Guerra <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="FGuMPNkRBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jgu...@...> wrote:
>
> I've got a pages controller [which is a catch all for most pages on my site] and in it, I have defined an invoice page.
>
> Just a bunch of users I would need to invoice [manually for now]
>
> so, I created a method called 'update_invoice_link'.  how would I manually create this route and what action or url do I need in my form field?
>
> Thanks,
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FGuMPNkRBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FGuMPNkRBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/804cc6ce-c3c9-4334-ad33-3135d22c5942%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3b9985bf-32f1-4899-9b0f-14977282507a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.