Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing inline-partial rendering issue... #126

Closed
wants to merge 1 commit into from

Conversation

willrjmarshall
Copy link

I've got a fix in for the Rails 3.1 issue discussed at #42

It was not similar to the described HAML bug, but a separate issue entirely.

…rinting Rabl::Engine.to_s. We now render to the first format in ActionView::Template.formats to fix this
@nesquena
Copy link
Owner

Does this work for Rails 3 and Rails 3.1?

@willrjmarshall
Copy link
Author

Hmm. I'd forgotten to check that.

I've got a test-case I can check against tomorrow morning, but not tonight unfortunately.

If not we can, as you suggested, split this out into 3.0 and 3.1 implementations, which is pretty straightforward.

@nesquena
Copy link
Owner

Yeah reply back when you know if its Rails 3 compatible as well. If it is, I am happy to pull it in! Thanks for putting this together.

@nesquena
Copy link
Owner

@willrjmarshall Any luck checking that this is Rails 3 compatible?

@willrjmarshall
Copy link
Author

Hey,

Haven't had a chance yet! Will get onto it ASAP ;)

@nesquena
Copy link
Owner

nesquena commented Nov 6, 2011

willrjmarshall Any chance to test soon, would love to push this out in the next gem release.

@willrjmarshall
Copy link
Author

First thing in the AM. Sorry for the slow - been crazy-busy

@willrjmarshall
Copy link
Author

It doesn't work in Rails 3.0 - so we should split it into two blocks as with the Rails 2 split. Does anyone else have time to make this change? I'm a little stuck for time.

@nesquena
Copy link
Owner

I think this was ultimately fixed. Closing.

@nesquena nesquena closed this Feb 12, 2012
@dtuite
Copy link

dtuite commented Feb 26, 2012

This doesn't appear to work for me using Rails 3.2.1 and Rabl 0.5.4. It just renders the text of the rabl template file rather than producing any json.

# app/views/searches/show.html.erb
<script>
  $(function(){
    var search = new Domainer.Models.Search(<%= render("searches/show.json.rabl", object: @search) %>);
  });
</script>
# app/views/searches/_show.json.rabl
object @search
attributes :id, :name
# output produced in app/views/searches/show.html.erb
<script>
  $(function(){
    var search = new Domainer.Models.Search(object @search
attributes :id, :name
);
</script>

@matthew342
Copy link

This appears to be back in Rails 3.2.6 - calling this:

render('cows/index.api_v1.rabl', object: @cows)

from an html template gives:

Missing partial cows/index.api_v1 with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :prawn, :haml, :rabl]}.

@matthew342
Copy link

Scratch that - this works if called this way:

render(file: 'posts/index', formats: :json).html_safe

as per the rails 3.2 posts integration test.. never hurts to read the source! Will propose an update to the Backbone Integration section of the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants