Ruby on Rails Monday, March 31, 2014

Hello people,

I am developing an app with Rails 4.0.x and I have a strange bug in its view. Say I have a partial like this

%p= @bject,name # would work perfectly

= render @object.friends # It won't fetch this relation

%p= @object,name # It would say can't find name for nil class

For some reason the above stuff happens. However in the rails console, all would work fine. Kinda confused.

Would be great if any one could throw light on this. Don' know if this is a Rails bug where state of instance variable gets forgotten after some time.


-----

Regards

Karthikeyan A K

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1405a3bb-1f4d-4c77-9628-2b7f887a7655%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails


On Monday, March 31, 2014 9:26:34 PM UTC+1, Peter D Bethke wrote:

Now I'm considering Comfortable Mexican Sofa because its really seems to be actively developed and does seem to function as a plug-in instead of a self-enclosed system (leaving me more to mess around with), though it seems to lack a robust user system (though from what I have read "there's a gem for that").


I've used  comfortable mexican sofa (although it wasn't me that did the review of what else was available at the time). When we were looking for a cms to use we mainly wanted something not too massive and that was reasonable easy to customize (for example with comfortable mexican helper you can whitelist normal view helpers for use by the cms content, so it's easy to add dynamic content to cms generated pages).

Fred

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f26201a4-2ccf-4a0a-8c26-80b394772728%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Patrick Peak spoke at the dcrug meet up just last month.  He (and his company BrowserMedia / nclude) are actively finishing up the Rails 4 version.  I think he’d be pretty interested in feedback and perhaps some contributions.  BrowserMedia uses the CMS for a lot of their projects so I have no doubt that Patrick will get it Rails 4 ready.


Maybe message him at peakpg on github.

------

Locomotivecms has a good website to go with it with some real docs and videos and an active google group so it seems like platform that might have some continued development moving forward.  The wagon / engine dichotomy had me a bit confused in the beginning (wagon is only a front end tool, not the entire app)

I did not even see comfy…sofa on my pass through rails CMS’s a few weeks back.  The group seems much less active than comfy.  I’ve also had some trouble even finding a few comfy demo sites to review.  Doc is very tech-y.

Overall, locomotive seems the most polished for now.


On Mar 31, 2014, at 4:26 PM, Peter D Bethke <pdbethke@gmail.com> wrote:

Hello all,


I’m moving to Rails from another OO language where I’ve built my own extensive CMS systems - and I’m the kind of guy who learns by breaking things and figuring out why they broke. Strange method but true - I guess I’m just the impatient sort :)

Since I’m most familiar with CMS architecture and multi-level user/group/authenicated access systems I thought it logical to start with a Rails CMS app to see how its put together there. Naturally I’m at a loss where to start because there seem to be a lot of them.

Initially I was interested in BrowserCMS because of its in-page editing (neat) and group-based access model, but although it says its Rails 4 compatible, when I load the gem it downloads a whole slew of Rails 3.2 gems to support it - leading me to believe its not truly Rails 4 ready. Maybe I’m mistaken.

Now I’m considering Comfortable Mexican Sofa because its really seems to be actively developed and does seem to function as a plug-in instead of a self-enclosed system (leaving me more to mess around with), though it seems to lack a robust user system (though from what I have read “there’s a gem for that”).

I’ve looked at Refinery (seems really out of date) and locomotive and a few others. Comfy seems the only one that is making an effort to stay up with the latest rails. I may be wrong - just an initial impression. 

Any thoughts? Just looking for an impartial recommendation for an “experienced newbie” as it were.


Best,

Peter Bethke


--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2aee26f4-966f-40e5-8596-dbe5163d5a83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello all,


I'm moving to Rails from another OO language where I've built my own extensive CMS systems - and I'm the kind of guy who learns by breaking things and figuring out why they broke. Strange method but true - I guess I'm just the impatient sort :)

Since I'm most familiar with CMS architecture and multi-level user/group/authenicated access systems I thought it logical to start with a Rails CMS app to see how its put together there. Naturally I'm at a loss where to start because there seem to be a lot of them.

Initially I was interested in BrowserCMS because of its in-page editing (neat) and group-based access model, but although it says its Rails 4 compatible, when I load the gem it downloads a whole slew of Rails 3.2 gems to support it - leading me to believe its not truly Rails 4 ready. Maybe I'm mistaken.

Now I'm considering Comfortable Mexican Sofa because its really seems to be actively developed and does seem to function as a plug-in instead of a self-enclosed system (leaving me more to mess around with), though it seems to lack a robust user system (though from what I have read "there's a gem for that").

I've looked at Refinery (seems really out of date) and locomotive and a few others. Comfy seems the only one that is making an effort to stay up with the latest rails. I may be wrong - just an initial impression. 

Any thoughts? Just looking for an impartial recommendation for an "experienced newbie" as it were.


Best,

Peter Bethke

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2aee26f4-966f-40e5-8596-dbe5163d5a83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Mon, Mar 31, 2014 at 11:32 AM, Jan Yo <lists@ruby-forum.com> wrote:
> Using Rails 4. I have a text_area_tag with submit_tag to do a query. I
> need to add a button to clear out the textarea and resubmit the form
> (using form_tag)
>
> Layout looks like this:
> Textarea
> Query Button 1 Clear Button
>
> Code looks like this:
> form_tag ....
> text_area_tag
> submit_tag "Query Button"
> end form tag
>
> Any ideas? Ajax was suggested.

?! Why would you want to submit an empty form?

Regardless, just create another submit button with an onsubmit
handler to set the textarea value to "".

But I still can't imagine your use case...

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yB7G-ON627RSfuD-JzFKyZiPwDtHakgN4b3yZ%3D%3DZYOxdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Using Rails 4. I have a text_area_tag with submit_tag to do a query. I
need to add a button to clear out the textarea and resubmit the form
(using form_tag)

Layout looks like this:
Textarea
Query Button 1 Clear Button

Code looks like this:
form_tag ....
text_area_tag
submit_tag "Query Button"
end form tag

Any ideas? Ajax was suggested.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7221c18cf3230ea1bd11375660b95d83%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

@Peter Heylin Check the console if any there are any javascript errors. And view page source, to see if jquery-ujs is being loaded. If it's not add it in the application.js as manifest.


On Mon, Mar 31, 2014 at 10:02 PM, Peter Heylin <peterheylin@gmail.com> wrote:
Thanks for the replies. 

@Claudiu I have fixed the link you mentioned and the app is doing the same thing. The show action is being fired when I click the Delete link

@Abdulsattar how I can I check if jquery-ujs is being loaded properly. The confirmation is not popping up. What change might be required to fix this? 

Thanks 

Peter


On Monday, 31 March 2014 17:02:09 UTC+1, Peter Heylin wrote:
Hi All,

I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: 

Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000
Processing by PostsController#show as HTML
  Parameters: {"id"=>"2"}
  Post Load (0.1ms)  SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1  [["id", "2"]]
  Comment Load (0.1ms)  SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ?  [["post_id", 2]]
  Rendered posts/show.html.erb within layouts/application (9.0ms)
Completed 200 OK in 120ms (Views: 117.3ms | ActiveRecord: 0.2ms)

My destroy method in the controller is: 

def destroy
    @post = Post.find(params[:id])
    @post.destroy

    redirect_to posts_path
end


The code in the index view is: 

       <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>

Would anyone have any idea what I might be missing here? 

Any help appreciated

Peter

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/be04aa29-ec7e-4cb2-bcf8-a50b58034206%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Abdulsattar Mohammed

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAGqGsFQ%2B%3Dg0F-vrJQGJJgdszhL2mXq1otxHSNGovJaP5ZWGeOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks for the replies. 

@Claudiu I have fixed the link you mentioned and the app is doing the same thing. The show action is being fired when I click the Delete link

@Abdulsattar how I can I check if jquery-ujs is being loaded properly. The confirmation is not popping up. What change might be required to fix this? 

Thanks 

Peter


On Monday, 31 March 2014 17:02:09 UTC+1, Peter Heylin wrote:
Hi All,

I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: 

Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000
Processing by PostsController#show as HTML
  Parameters: {"id"=>"2"}
  Post Load (0.1ms)  SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1  [["id", "2"]]
  Comment Load (0.1ms)  SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ?  [["post_id", 2]]
  Rendered posts/show.html.erb within layouts/application (9.0ms)
Completed 200 OK in 120ms (Views: 117.3ms | ActiveRecord: 0.2ms)

My destroy method in the controller is: 

def destroy
    @post = Post.find(params[:id])
    @post.destroy

    redirect_to posts_path
end


The code in the index view is: 

       <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>

Would anyone have any idea what I might be missing here? 

Any help appreciated

Peter

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5891609c-b4cd-446c-9878-0ecc9aa8622c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks for the replies. 

@Claudiu I have fixed the link you mentioned and the app is doing the same thing. The show action is being fired when I click the Delete link

@Abdulsattar how I can I check if jquery-ujs is being loaded properly. The confirmation is not popping up. What change might be required to fix this? 

Thanks 

Peter


On Monday, 31 March 2014 17:02:09 UTC+1, Peter Heylin wrote:
Hi All,

I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: 

Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000
Processing by PostsController#show as HTML
  Parameters: {"id"=>"2"}
  Post Load (0.1ms)  SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1  [["id", "2"]]
  Comment Load (0.1ms)  SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ?  [["post_id", 2]]
  Rendered posts/show.html.erb within layouts/application (9.0ms)
Completed 200 OK in 120ms (Views: 117.3ms | ActiveRecord: 0.2ms)

My destroy method in the controller is: 

def destroy
    @post = Post.find(params[:id])
    @post.destroy

    redirect_to posts_path
end


The code in the index view is: 

       <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>

Would anyone have any idea what I might be missing here? 

Any help appreciated

Peter

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/be04aa29-ec7e-4cb2-bcf8-a50b58034206%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Check if jquery-ujs is being loaded properly. I'd wager, your "Are you sure?" confirmation isn't even popping up.


On Mon, Mar 31, 2014 at 9:42 PM, Claudiu Clau <claudiu.garba@gmail.com> wrote:
I think here is the error:        <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>
= link_to 'Destroy', post_path(post), bla bla bla

On Monday, March 31, 2014 6:02:09 PM UTC+2, Peter Heylin wrote:
Hi All,

I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: 

Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000
Processing by PostsController#show as HTML
  Parameters: {"id"=>"2"}
  Post Load (0.1ms)  SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1  [["id", "2"]]
  Comment Load (0.1ms)  SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ?  [["post_id", 2]]
  Rendered posts/show.html.erb within layouts/application (9.0ms)
Completed 200 OK in 120ms (Views: 117.3ms | ActiveRecord: 0.2ms)

My destroy method in the controller is: 

def destroy
    @post = Post.find(params[:id])
    @post.destroy

    redirect_to posts_path
end


The code in the index view is: 

       <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>

Would anyone have any idea what I might be missing here? 

Any help appreciated

Peter

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e765b1b0-b7d5-4038-92c1-e6f6c0122c59%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Abdulsattar Mohammed

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAGqGsFTgqyUDFfbNOHNpQysf7W7KRFPW2T%2BFpk8%3DTpH%3DWhLU6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I think here is the error:        <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>
= link_to 'Destroy', post_path(post), bla bla bla
On Monday, March 31, 2014 6:02:09 PM UTC+2, Peter Heylin wrote:
Hi All,

I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: 

Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000
Processing by PostsController#show as HTML
  Parameters: {"id"=>"2"}
  Post Load (0.1ms)  SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1  [["id", "2"]]
  Comment Load (0.1ms)  SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ?  [["post_id", 2]]
  Rendered posts/show.html.erb within layouts/application (9.0ms)
Completed 200 OK in 120ms (Views: 117.3ms | ActiveRecord: 0.2ms)

My destroy method in the controller is: 

def destroy
    @post = Post.find(params[:id])
    @post.destroy

    redirect_to posts_path
end


The code in the index view is: 

       <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>

Would anyone have any idea what I might be missing here? 

Any help appreciated

Peter

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e765b1b0-b7d5-4038-92c1-e6f6c0122c59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi All,

I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: 

Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000
Processing by PostsController#show as HTML
  Parameters: {"id"=>"2"}
  Post Load (0.1ms)  SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1  [["id", "2"]]
  Comment Load (0.1ms)  SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ?  [["post_id", 2]]
  Rendered posts/show.html.erb within layouts/application (9.0ms)
Completed 200 OK in 120ms (Views: 117.3ms | ActiveRecord: 0.2ms)

My destroy method in the controller is: 

def destroy
    @post = Post.find(params[:id])
    @post.destroy

    redirect_to posts_path
end


The code in the index view is: 

       <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'}  %></td>

Would anyone have any idea what I might be missing here? 

Any help appreciated

Peter

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9d5a96bd-6ba7-4a7b-876b-462feac748fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Captain America: The Winter Soldier (2014) Full Movie Free Download:

http://captainamerica.metroblog.com/


https://www.facebook.com/captainamericathewintersoldiermovie


http://tweetvite.com/event/captainamericathewinter

HELLO Movie LOVERS!!! Welcome to download and watch here Captain
America: The Winter Soldier (2014) Full Movie Free online HD Quality.
Hope you will really enjoy this New movie Captain America: The Winter
Soldier (2014) Full Movie Free. Think you do not miss to watch Captain
America: The Winter Soldier (2014) Full Movie Free, Just relax to
Captain America: The Winter Soldier (2014) Full Movie Free HD
online.This Link will help you out on finding ways on how to download
and watch Captain America: The Winter Soldier (2014) Full Movie Free
online on your computer and also Laptop.

Wellcome to all the Movie Fans, Watch this hot and big Captain America:
The Winter Soldier (2014) Full Movie Free on your PC with 100% High
Quality Definitions (HQD). Movie lovers around the world, looking for
this movie online to watch Captain America: The Winter Soldier (2014)
Full Movie Free, Watch The movie online! Don't miss this movie
today.Catch Full HD Action.You are most invited to movie downloading.You
know every moment of Captain America: The Winter Soldier (2014) Full
Movie Free is very much exciting and enjoyable.This movie is also too
much enjoyable. Watching the movie Captain America: The Winter Soldier
(2014) Full Movie Free online for using below this link.Just follow the
link and start watching With 100% HD quality… So don't late to watch
Captain America: The Winter Soldier (2014) Full Movie Free only on here.

Enjoy the movie Captain America: The Winter Soldier (2014) Full Movie
Free on your PC on Friday. Grab this exciting movie on your PC in this
site.Catch the movie here it provide crystal clear HD video and smooth
clear sound so stay tune and enjoy the movie here

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d927f3c8045db94d1bc31e60f24822cd%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hey guys,

I am really looking for some help on this question:

http://stackoverflow.com/questions/22761692/validates-on-update-being-called-when-saving-object-as-nested-attribute

probably somebody can bring me some light into this?

all the best,

Andre

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2ef6ec7c-9c6b-41f9-9731-fcb32546d16b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I've added another engine.  Again it runs just fine as a stand alone application (test/dummy) and as an engine inside the main application, but this time when I use cucumber it mangles the route.  The generated controller name is NamespaceController, instead of Namespace::Controller.

The only significant difference between the various engines is that each time I create a new engine I get different versions of various gems like childprocess, docile, and jquery_rails.  Am I getting incompatible versions of these gems?  If so, how do I control this when I create a new engine?

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d1cced05-d80b-4c3c-a70e-b2ffad49074c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Saturday, March 29, 2014 3:43:32 PM UTC, Jeff wrote:
What do people who use SequelPro (and related tools) do to trigger their action filters usually?

Writing an API sounds ideal but what if you have little control over the tool.


If your after filters only do db changes then you may be able to use a trigger (possibly using something like postgres' notification events). Other than that you can't detect arbitrary changes to your database (and even using triggers, those could in general be altered/disabled by this hypothetical person using sequel pro)

Fred 

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f2ead96a-49d4-4b83-b974-47e9ea057fdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi,

I'm looking for a way to solve an error I get each times I run my functional tests. I have a Rails Engine gem (isolated), I have a JSON action with a route declared. But each times I use the method get in a test I get an ActionController::UrlGenerationError exception.

Here an example of code with the problem:
# config/routes.rb  MyEngine::Engine.routes.draw do    resources :cats, only: [:show], format: 'json'  end    # test/dummy/config/routes.rb  Rails.application.routes.draw do    mount MyEngine::Engine => '/my_engine'  end    # app/controllers/my_engine/cats_controller.rb  module MyEngine    class CatsController < ApplicationController      def show        render json: { hello: 'world' }      end    end  end    # test/controllers/my_engine/cats_controller_test.rb  module MyEngine    class CatsControllerTest < ActionController::TestCase     test 'should get success' do        get :show, id: 42          assert_response :success      end    end  end
Here is an example of test return:

1) Error:  MyEngine:: CatsControllerTest#test_should_get_success:  ActionController::UrlGenerationError: No route matches {:action=>"show", :controller=>"my_engine/cats", :id=>"42"}

Anyone have an idea to solve this problem?

Thanks.

-----
Geoffrey Roguelon

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/06e665fd-7a76-4d98-9d91-171e4dc6bf6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Sunday, March 30, 2014

Hello everyone!

In case you missed DHH's tweet ( https://twitter.com/rails/status/449891895142277120 ) the other day, our team just opened up the 2014 Rails Hosting Survey

If you have 5 minutes to spare, can you share how you're deploying and hosting your Rails applications with the rest of the community?

You can take the survey at: http://rails-hosting.com/

Thanks in advance,
Robby

P.S. We will be collecting responses until April 30th, 2014. 

Robby Russell
Partner | Planet Argon
http://planetargon.com/robby

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/991a407a-3145-4d78-9e09-90c86ede0713%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Saturday, March 29, 2014 1:02:45 PM UTC-4, Me wrote:
I have a rails 4 app that has a link_to with a post method but I keep getting:

No route matches [GET] "/payments/136330"


<%= link_to("Buy Now", buy_path(list_item), :method => :post) %>

Ideas??

a little difficult without a full log, but a strong, educated guess would be that there's a javascript problem.  Links always generate a GET action.  When you use :method => :post, there's javascript in the rails javascript file that detects it, re-writes the link as a form, and submits it as a post.  If that javascript is missing, or if there's a javascript error that prevents it from executing, you'll get the message you're getting above.

@mike2r

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/70d6b54d-d843-4d46-a7a1-3381774cb5ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Post your routes.rb file

On Saturday, March 29, 2014 1:02:45 PM UTC-4, Me wrote:
I have a rails 4 app that has a link_to with a post method but I keep getting:

No route matches [GET] "/payments/136330"


<%= link_to("Buy Now", buy_path(list_item), :method => :post) %>

Ideas??

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/53ada596-02f9-4a06-8821-d6f7370daa58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Saturday, March 29, 2014

Hi,

Recently, we released a v.0.0.2 of our gem 'Rails-Legit'. This allows a clean interface to add validations for Arrays, Hashes and Time objects. Check it out at https://github.com/code-mancers/rails_legit. Do open an issue if anything breaks. Open to suggestions too!


Thank you

-- 

Kashyap
www.codemancers.com

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8445ec40-db6a-4a3b-be04-29a17ed08c23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

That is the only route for that controller.


On Sat, Mar 29, 2014 at 12:33 PM, Loganathan Sellapa <loganathan.ms@gmail.com> wrote:

Hi,

Can you copy your full routes.rb, I believe you should place the route at before the route
"resources :payment"

Regards,
Logan

Sent from mobile device


On 29 Mar 2014 22:34, "Me" <chabgood@gmail.com> wrote:
>
> Route,  post 'payments/:list_item_id', to: 'payments#buy', :as => :buy
>
>
> On Saturday, March 29, 2014 12:02:45 PM UTC-5, Me wrote:
>>
>> I have a rails 4 app that has a link_to with a post method but I keep getting:
>>
>> No route matches [GET] "/payments/136330"
>>
>> <%= link_to("Buy Now", buy_path(list_item), :method => :post) %>
>>
>> Ideas??
>
> --
> 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-talk+unsubscribe@googlegroups.com.

> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/21350ab3-a33d-41cb-9061-e103db36b31b%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/3kI7VkfKp4Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAD_i5MEUqTeM9YMdJCJKUL9Sa9MmCVmtT6ka2smS2TtNtooNZA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
"In matters of style, swim with the current; in matters of principle, stand like a rock." 
Thomas Jefferson

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAKohUFyG9%2BcZ3RoLXUUzmEsKmJtdCxq66T7qJYHjKNcYvTnKPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi,

Can you copy your full routes.rb, I believe you should place the route at before the route
"resources :payment"

Regards,
Logan

Sent from mobile device
On 29 Mar 2014 22:34, "Me" <chabgood@gmail.com> wrote:
>
> Route,  post 'payments/:list_item_id', to: 'payments#buy', :as => :buy
>
>
> On Saturday, March 29, 2014 12:02:45 PM UTC-5, Me wrote:
>>
>> I have a rails 4 app that has a link_to with a post method but I keep getting:
>>
>> No route matches [GET] "/payments/136330"
>>
>> <%= link_to("Buy Now", buy_path(list_item), :method => :post) %>
>>
>> Ideas??
>
> --
> 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-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/21350ab3-a33d-41cb-9061-e103db36b31b%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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAD_i5MEUqTeM9YMdJCJKUL9Sa9MmCVmtT6ka2smS2TtNtooNZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Please change your name from "Me" to something else. It's confusing.

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAGHQMcg8mkp-%3DUDXff443cH22Ac9j%2BeuzXPpOf5m77F9q-zStA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Route,  post 'payments/:list_item_id', to: 'payments#buy', :as => :buy

On Saturday, March 29, 2014 12:02:45 PM UTC-5, Me wrote:
I have a rails 4 app that has a link_to with a post method but I keep getting:

No route matches [GET] "/payments/136330"


<%= link_to("Buy Now", buy_path(list_item), :method => :post) %>

Ideas??

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/21350ab3-a33d-41cb-9061-e103db36b31b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I have a rails 4 app that has a link_to with a post method but I keep getting:

No route matches [GET] "/payments/136330"


<%= link_to("Buy Now", buy_path(list_item), :method => :post) %>

Ideas??

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c0f40a7c-0fb7-4d40-9d12-51cd8bb0cdd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

What do people who use SequelPro (and related tools) do to trigger their action filters usually?

Writing an API sounds ideal but what if you have little control over the tool.



On Friday, March 28, 2014 6:46:37 AM UTC-7, mike2r wrote:


On Friday, March 28, 2014 8:47:24 AM UTC-4, Hassan Schroeder wrote:
On Fri, Mar 28, 2014 at 5:00 AM, Walter Lee Davis <wa...@wdstudio.com> wrote:

>> I have an external process changing the database of my app. Is there a good way to trigger the before save and after save filters for models that get updated, when it is an external process changing it?

> Try to think more about your overall application architecture. Maybe your "external process" can call an API in your Rails app instead of changing the database directly, behind its back.

+1 - this scenario has "data integrity fail" stamped all over it.

If you can't avoid having the external process write to the db, at least
have it write to *non-model* tables and incorporate the updates from
there (via periodic rake task, or whatever).

Good luck.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

agree with the data integrity concerns.  if it's possible, I think the API solution above is the best option.  It is possible to write a batch invocation of ActiveRecord which your external process would have to call, but I think the cleanest way to insure all the before/after filters are executed is by building an API.  

If you're going to hit the database directly, at least push your model constraints back into the database so that integrity is maintained.  That still potentially leaves an issue with your before/after filters.  For example, if you have an after filter that writes to a log/audit file after a transaction is saved, that won't get executed.  Again, API would be the cleanest and consistent with the way systems interface to each other.

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/61df7399-4647-4c19-ad68-2c3cde7414d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Friday, March 28, 2014

DONT BELIEVE LINK ABOVE ME!! HE JUST GAVE MISLEADING LINK!!
I'll give you a link which will help you to the fullest in order to
satisfy your hobby in the movie world.
This link will help you to save money, time, energy, speed of access,
etc.. here >>>>>>

http://piclover.net/watch/play.php?movie=1843866


OR YOU CAN SEE OTHER GREAT MOVIE HERE >>>>>>

http://watchfullmoviehdstreaming.nation2.com/index.php?page=1604697958

~FREE sign up

~Watch as many movies you want!

~Secure and no restrictions!

~Thousands of movies to choose from - Hottest new releases.

~Click it and Watch it! - no waiting to download movies, its instant!

~Download at full speed with unlimited bandwidth with just one click!

~Stream movies in HD quality!

~Guaranteed to save time and money - Its quick and hassle free,

~It works on your TV, PC or MAC!

~Fully optimized for all platforms - no additional software required!

happy watching!! :)

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d9d1e6042d27a8587961b69a3f329860%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Happy Friday Everyone!

We are doing some international work and are seeking talent who have strong communication skills in both Spanish (Mexico) and English. Interested in developers who enjoy learning new technologies.


- Developer (HTML, CSS, JS/Jquery, Ruby on Rails) 1-3yrs experience, Onsite in Los Angeles (El Segundo)

We have an immediate start and are open to freelance and fulltime candidates who can start in the next 1-2weeks.

Booz Digital is a new division of Booz @ Co (top strategy firm). Our capabilities are Strategy, Design, and Technology and we are uniquely positioned due to our strategy roots to focus on solving business solutions for our Fortune 50/100 clients. 

We are about a year into our lifecycle and are expecting continued growth this year.


Here is why I work for Booz Digital:
• We are product centric and believe in Human Centered Design
• We are only interested in building high impact solutions for our clients business and consumer (no maintenance)
• We work with Fortune 100/50 clients
• We are known for our digital strategy, which means we have a lot of impact on how to solve problems (vs "we need an app")
• We are interested in solutions that go beyond web and mobile


www.booz.com/digital

Please send resume to sierra.kulak@contractors.booz.com



If you are interested in learning more about Booz Digital in consideration for future opportunities, please email me for an informational interview.

We are always interested in meeting Strategists, Technologists, Producers, and UX/UI Designers.

Cheers,

Sierra



SIERRA KULAK
Recruiter

Booz & Company (N.A.) Inc.
2141 Rosecrans Ave, Suite 5100
El Segundo, CA 90245
sierra.kulak@contractors.booz.com
www.booz.com

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9fc46f59-59c4-4eaa-a278-ef29437c4597%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Fri, Mar 28, 2014 at 3:21 PM, Dean Hiller <lists@ruby-forum.com> wrote:

> I find it sad when people go with "we don't need to fix it"

I find it sad when people "reply" to *six-year-old posts* about a
rapidly evolving platform.

Sorrow manifests in many forms :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yChoQ9WpyAxpEFyzHF40VhMKXPXRTwbQRP4Ge9oWeteDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I 100% agree with the OP. In the playframework, you get this for free.
All you do is validation.keep() and params.flash() and do the redirect
and on a GET request it automatically fills in the user input and
errors. ie. you get no breakage of the back button which is very
annoying even for users who are experts. This project looks very very
promising but is only for rails 4 I think
https://github.com/tommeier/rails-prg

I find it sad when people go with "we don't need to fix it" when it is
so simple to fix and many other frameworks like seam, playframework are
now ahead of rails in this aspect.

ruby invented the flash scope and playframework and seam stole it and
really used it to their advantage in a way better way than ruby giving a
much better user experience when it comes to the back button.

Dean

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a73f4526a6c2a008a8124d93e8c3e126%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Please help.  I am stumped.

I have four engines inside a rails application. The cucumber scenarios run just fine in three of the engines.  The fourth fails with the error:

  No route matches [GET] "/stylesheets/common_engine/application.css" (ActionController::RoutingError)
  /usr/local/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.17/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'

I can not see any significant differences between configuration files of the applications that work and this one.

The test/dummy application runs just fine ($ rails server) with RAILS_ENV set to either 'development' or 'test'.

All applications/engines are running ruby 1.9.3, rails 3.2.17, and cucumber 1.3.10.  Google did not help.

Thank you.


--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0d3cb976-f6c2-4bc3-a464-5aa990870948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Friday, March 28, 2014 8:47:24 AM UTC-4, Hassan Schroeder wrote:
On Fri, Mar 28, 2014 at 5:00 AM, Walter Lee Davis <wa...@wdstudio.com> wrote:

>> I have an external process changing the database of my app. Is there a good way to trigger the before save and after save filters for models that get updated, when it is an external process changing it?

> Try to think more about your overall application architecture. Maybe your "external process" can call an API in your Rails app instead of changing the database directly, behind its back.

+1 - this scenario has "data integrity fail" stamped all over it.

If you can't avoid having the external process write to the db, at least
have it write to *non-model* tables and incorporate the updates from
there (via periodic rake task, or whatever).

Good luck.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

agree with the data integrity concerns.  if it's possible, I think the API solution above is the best option.  It is possible to write a batch invocation of ActiveRecord which your external process would have to call, but I think the cleanest way to insure all the before/after filters are executed is by building an API.  

If you're going to hit the database directly, at least push your model constraints back into the database so that integrity is maintained.  That still potentially leaves an issue with your before/after filters.  For example, if you have an after filter that writes to a log/audit file after a transaction is saved, that won't get executed.  Again, API would be the cleanest and consistent with the way systems interface to each other.

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2810ca67-2d99-4b83-9bed-4b11e0a635ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

The easiest way to have an external process run within your application context is to write your external app in ruby and run it inside a call to rails runner ... . You pay a penalty at startup but gain access to your application's environment (think rails console).

There is nothing inherently wrong with having multiple clients working out of the same database tables. The complications come when more than one client tries to modify the same field in the same record at the same time. Two strategies come to mind.

First, you can use roles (db_mgr and db_user) to restrict access to 'troubling' actions. You would require all change activity (create/update/delete) to be done only by db_mgr. Database tables could then be managed by your offline application.

Second, you can bring your application to a reduced state - don't forget to notify users - and manage your tables while the database is quiet.



On Friday, March 28, 2014 8:47:24 AM UTC-4, Hassan Schroeder wrote:
On Fri, Mar 28, 2014 at 5:00 AM, Walter Lee Davis <wa...@wdstudio.com> wrote:

>> I have an external process changing the database of my app. Is there a good way to trigger the before save and after save filters for models that get updated, when it is an external process changing it?

> Try to think more about your overall application architecture. Maybe your "external process" can call an API in your Rails app instead of changing the database directly, behind its back.

+1 - this scenario has "data integrity fail" stamped all over it.

If you can't avoid having the external process write to the db, at least
have it write to *non-model* tables and incorporate the updates from
there (via periodic rake task, or whatever).

Good luck.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/da038294-85a2-4eb0-a15e-d6516810a635%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.